Overview
Syllabus
Intro
Developer oriented automated tests
integration
py.test fundamental features
cross-project test tool
automatic test discovery
no boilerplate python test code
test classes with pytest
assert introspection
asserting expected exceptions
Failure / Traceback Demo
Dependency injection
Beyond simple testing: fixtures!
Example of a simple pytest fixture
Scoping fixture functions
Parametrizing fixtures
Parametrizing tests directly
Modularity: using fixtures from fixtures
Classes can use fixtures as well
Autouse fixtures
Fixture summary
comparison with unittest
plugins, plugins ...
pytest-coverage example
Using the distribution plugin
Upcoming Pytest-2.4 feature
Integrating context managers (2.4)
Tests need design and thought!
Taught by
EuroPython Conference