pytest
Mer info
- Skapad av
- Holger Krekel
- År
- Typ
- Python test-runner
- Licens
- MIT
- Officiell sajt
- pytest.org
- Källkod
- github.com/pytest-dev/pytest
Pythons de facto-standard test-runner — minimal syntax, kraftfulla fixtures, parametrize. Slog ut unittest från standard library.
Skriv def test_foo(): assert x == y. Inget class-arv som unittest. Fixtures (via @pytest.fixture + dependency injection) är killer-feature. @pytest.mark.parametrize för data-driven tester. Pluginekosystem är massivt: pytest-django, pytest-asyncio, pytest-cov, hypothesis (property-based testing). Default i de flesta moderna Python-projekt.