Testing
Test runners
| Name | Short description | 🚦 |
|---|---|---|
| pytest | A framework for writing and running tests. We recommend pytest over unittest because pytest tends to encourage a cleaner style, there are also extensive plugins and it’s in widespread use. |
Best |
| tox | A framework that allows running tests and packaging in different environments. | Best |
| unittest | Python’s built in framework for writing and running tests. Encourages use of classes as test fixtures. | Good |
pytest plugins
| Name | Short description | 🚦 |
|---|---|---|
| pytest-cov | A framework to generate coverage reports that plays nicely with pytest. |
Best |
| pytest-mock | A framework to mock/patch objects that plays nicely with pytest. |
Best |
| pyfakefs | A plugin to create a full fake file system, for situations where you need something more complicated than the built in tmp_path fixture. |
Best |
Property based testing
| Name | Short description | 🚦 |
|---|---|---|
| Hypothesis | Allows one to easily test multiple inputs for a given function with ease | Best |