pytest
Meer info
- Gemaakt door
- Holger Krekel
- Jaar
- Type
- Testrunner voor Python
- Licentie
- MIT
- Officiële site
- pytest.org
- Broncode
- github.com/pytest-dev/pytest
De de-factostandaard voor Python-tests: minimale syntaxis, krachtige fixtures en parametrize. Het zette unittest uit de standaardbibliotheek buitenspel.
Schrijf def test_foo(): assert x == y en klaar, zonder klasse-overerving zoals bij unittest. Fixtures (via @pytest.fixture en dependency injection) zijn de killerfeature, @pytest.mark.parametrize dekt datagedreven tests. Het pluginecosysteem is enorm: pytest-django, pytest-asyncio, pytest-cov en hypothesis (property-based testing). Standaard in vrijwel elk modern Python-project.