Choosing a testing framework At the moment the best 3 frameworks for testing in Python are Pytest, Unitest and Nose From these three, Pytest turns out to be the best, and here are a few reasons why: 1. Allows for compact test suites Pytest basically introduced the concept that Python tests should be plain Python functions instead of forcing developers to include their tests inside large test classes. 2. Very pretty and useful failure information With most other tools you have to use debugger or extra logging to find out where did some value came from in your test. Pytest rewrites your test so that it can store all intermediate values that can lead to failing assert and provides you with very pretty explanation about what has been asserted and what have failed. Nose doesn’t deal with the expected failures that well. 3 Minimal boilerplate Tests written with pytest need very little boilerplate code, which makes them easy to write and understand. Unitest forces to write classes even though they are not really using them as objects. 4. Tests parametrization You can parametrize any test and cover all uses of a unit without code duplication. 5. Extensible (many of plugins are available) Pytest can easily be extended with several hooks, and the same team develops a number of very useful plugins. For example, you install pytest-xdist, and parallel test execution just works, with all the same benefits you had with pytest (as opposed to having to use a separate test runner, for example). Nose seems to have to much reliance on plugins which a lot of times are undocumented or have very little documentation. 6. Fixtures are simple and easy to use A fixture is just a function that returns a value and to use a fixture you just have to add an argument to your test function. You can also use a fixture from another fixture in the same manner, so it's easy to make them modular. You can also parametrize fixture and every test that uses it will run with all values of parameters, no test rewrite needed. If your test uses several fixtures, all parameters' combinations will be covered. 7. Test discovery by file-path There is no need for organizaing your tests in tests suites and adding the tests manually to them. The pytest discovery mechanism makes it very easy to discover and run all the tests from a file-path or directly from a pip installed package. 8. Unittest.TestCase Support pytest supports running Python unittest-based tests out of the box. It’s meant for leveraging existing unittest-based test suites to use pytest as a test runner and also allow to incrementally adapt the test suite to take full advantage of pytest’s features. Pytest is really good at running unittest and nose. If you switch from unittest or nose to pytest it won’t be too painful. 9. Unlike unittest and nose, the pytest framework uses the python "assert" statement, which makes writing tests very easy. You don't have to remember or lookup for a fancy assert function.