pytest is a popular third-party Python testing library for unit, functional, and integration tests. It favors concise syntax and less boilerplate than unittest. section 6.1.1
Use pytest when a project values simplicity and can accept a dependency beyond Python’s standard library:
- Build simple or complex unit tests with concise test code. section 6.1.1
- Organize setup and teardown with fixtures. section 6.1.1
- Run parameterized tests and existing unittest or nose test suites. section 6.1.1
Choosing pytest
Choose pytest for a Python project that needs more than isolated unit tests, values ease of use, and is not restricted to standard-library dependencies. section 6.1.1










