Metadata-Version: 2.4
Name: pytest-easy
Version: 0.0.5
Summary: Pytest, but made easy
License-File: LICENSE
Author: danialcala94
Author-email: danielalcalavalera@gmail.com
Requires-Python: >=3.8,<3.14
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: printer-easy (>=0.0.2,<1.0.0)
Requires-Dist: psutil (>=7.2.2,<9999.0.0)
Requires-Dist: python-dotenv (>=1.0.1,<9999.0.0)
Project-URL: Homepage, https://github.com/Implosiv3/pytest-easy
Project-URL: Issues, https://github.com/Implosiv3/pytest-easy/issues
Description-Content-Type: text/markdown

# Pytest, but made easy

The easiest way to test your projects with `pytest`.

# Why?
I had some tests that, when running all together, were failing due to memory issues. This is the way I solved it, and also I can log the results of my tests and clean the tests files folders very easy each time the tests are executed.

# Functionality
__Simplify__ the way we do our tests in python __and run tests individually__ to be more accurate (and a bit slower, but is testing, accuracy is more important).

There are 2 tags:
- __`mandatory`__ for the tests that __must be tested and passed always__ in order to go on, make a commit or upload a new version.
- __`additional`__ for the tests that are validating some optional or experimental functionality that is __not needed for a commit or a new version__.

You should tests always the `mandatory` to know that your app base code is still working, even though some experimental features could fail.

# Usage
The `tests` folder will be your new friend. Keep a `test_general.py` to always do a simple test. Have the `conftest.py` to configure what has to be done before and after the tests are running.

Some code to apply in your tests:

1. Test that an exception is raised with a specific message.
```
from pytest_easy import assert_exception_is_raised

assert_exception_is_raised(lambda: 1 / 0, exception_type = None, message = 'division by zero')
```

2. Compare float values
```
from pytest_easy import float_approx_to_compare

assert 3.99 == float_approx_to_compare(3.99)
```

3. Check that a dependency is not installed
```
from pytest_easy import is_dependency_installed

assert not is_dependency_installed('opencv-python')
```

Check `test_various.py` to see more examples.

This will execute the tests and remove all the new files in the `test_files` folder that were not before the tests were executed, or you can simply comment the `test_files_handler.delete_new_files()` line before running them, so the generated files are not removed in that execution, uncomment it, and they won't be removed in the next execution because they were already there.

There are some `.bat` files included to run the tests in 3 different modes:
1. `run_tests.bat` - Non-isolated mode, normal mode.
2. `run_tests_isolated.bat` - Isolated mode, our way.
3. `run_mandatory_tests.bat` - Run only the tests with the `@mandatory` pytest mark.
