How it works
A pytest test is a function whose name starts with test_, and a failing assert shows exactly which values differed. Fixtures supply what tests need, such as a database session or a signed-in client, and clean up afterwards, while @pytest.mark.parametrize runs one test over many inputs. It also runs older unittest-style tests, so projects can switch gradually.
A large plugin ecosystem adds coverage (pytest-cov), parallel runs (pytest-xdist), async tests (pytest-asyncio) and framework helpers such as pytest-django. FastAPI and Django projects commonly pair it with a test client to exercise API routes over HTTP without starting a real server.
pytest pricing
Related terms
More in Testing and quality
Test runners