Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Pytest - Rapid and Simple Testing with Python

EuroPython Conference via YouTube

Overview

Explore pytest, a rapid and simple testing framework for Python, in this EuroPython 2013 conference talk by Helger Krekel. Dive into developer-oriented automated tests, integration techniques, and fundamental py.test features. Learn about automatic test discovery, writing boilerplate-free Python test code, and utilizing test classes with pytest. Master assert introspection, exception assertion, and dependency injection. Discover the power of fixtures, including simple and parameterized examples, scoping, and modularity. Compare pytest with unittest, explore plugins like pytest-coverage, and get a glimpse of upcoming Pytest-2.4 features. Gain insights on test design and thoughtful implementation to enhance your Python testing practices.

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

Reviews

Start your review of Pytest - Rapid and Simple Testing with Python

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.