> Markdown version of [/videos/213-pytest-simple-rapid-and-fun-testing-with-python?t=1691](https://www.wearedevelopers.com/videos/213-pytest-simple-rapid-and-fun-testing-with-python?t=1691). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # pytest: Simple, rapid and fun testing with Python Ditch verbose unittest boilerplate for plain Python assertions. Pytest transforms your workflow with modular fixtures and a massive plugin ecosystem for scalable, maintainable test automation. - **Speakers:** Florian Bruhin - **Event:** World Congress 2021 - **Published:** June 29, 2021 - **Duration:** 47:19 - **URL:** https://www.wearedevelopers.com/videos/213-pytest-simple-rapid-and-fun-testing-with-python ## Summary Transitioning from verbose standard libraries like unittest to modern test frameworks requires a fundamental shift in how developers handle assertions and test state. This presentation breaks down why pytest has become the dominant testing framework in the Python ecosystem. By leveraging assertion rewriting, developers can write plain Python assert statements without losing introspection capabilities, allowing the framework to dynamically pinpoint exactly where and why a data structure mismatched without requiring complex, Java-style API methods.\n\nA major workflow improvement in pytest is its approach to state management and setup/teardown logic. Rather than relying on rigid xUnit-style class inheritance, pytest utilizes fixtures, described as "dependency injection done by pytest." This allows engineers to request modular setup functions as test arguments, seamlessly combine multiple fixtures, and handle teardown natively via the yield keyword. Additionally, test variation is handled cleanly through the parameterize decorator, treating each data variation as an isolated test case to ensure comprehensive reporting rather than obfuscating intermediate failures inside a standard loop.\n\nBeyond core functionality, a rich ecosystem of nearly 900 plugins extends pytest's capabilities across specialized testing domains. Engineering teams can integrate test coverage reporting, utilize behavior-driven Gherkin syntax, or adopt property-based testing with the hypothesis plugin to auto-discover edge cases by defining structural invariants rather than hardcoded inputs. Because pytest natively runs existing traditional test suites without modification, adopting it facilitates a frictionless transition to more expressive, maintainable, and scalable test automation. **Keywords:** python test automation, pytest framework, assertion rewriting, test parameterization, dependency injection, pytest fixtures, setup and teardown logic, pytest markers, test coverage reporting, behavior-driven development, property-based testing, hypothesis testing plugin, monkeypatching, xunit compatibility ## Chapters 1. **Discovering the importance of automated python testing** (00:03) — The transition from basic scripting to python highlights the necessity of automated testing for open-source projects. 1. **Overview of pytest fundamental testing features** (03:10) — An introduction to pytest's core capabilities demonstrates its versatility for syntax-light automation and cross-domain system testing. 1. **Historical origins and active project development of pytest** (05:38) — The historical evolution from the pypy project traces how pytest became a fully independent testing standard. 1. **Writing readable test assertions without boilerplate test classes** (06:51) — Replacing boilerplate test classes with standard assertions allows developers to extract detailed contexts instantly upon failure. 1. **Tagging and organizing execution scenarios with pytest markers** (11:28) — Using decorator markers allows teams to selectively skip, group, and tag tests across diverse functional requirements. 1. **Parameterizing test functions with different input datasets** (14:33) — Converting test loops into parameterized decorators isolates failure scenarios and cleanly supplies diverse data points. 1. **Managing setup and teardown code utilizing dependency-injected fixtures** (18:00) — Dependency-injected fixtures isolate setup routines into composable blocks rather than complex class inheritances or mixins. 1. **Handling files and overriding states via built-in fixtures** (24:21) — Built-in temporary directory handles and monkeypatching tools prevent conflicting states when managing files or environmental variables. 1. **Extending testing workflows using popular pytest plugins** (28:11) — Adding specialized community plugins supercharges test suites with code coverage generation, behavioral scenarios, and property-based variations. 1. **Next steps for migrating tests and upcoming framework releases** (33:42) — Migrating existing codebases with automated rewrite scripts paves the way for adopting upcoming major version capabilities. ## Related Moments - [Session summary and brief recap of learned testing concepts](https://www.wearedevelopers.com/videos/282-watch-tests-go-brrrr-getting-started-with-cypress-in-reactjs) (from "Watch Tests Go Brrrr! : Getting Started with Cypress in ReactJS") - [Reflecting on the core motivations for writing tests](https://www.wearedevelopers.com/videos/1678-the-2025-state-of-javascript-testing) (from "The 2025 State of JavaScript Testing") - [Introduction to keeping test code clean](https://www.wearedevelopers.com/videos/515-dirty-tests-and-how-to-clean-them) (from "Dirty Tests And How To Clean Them") - [Building confidence with the test automation pyramid](https://www.wearedevelopers.com/videos/1435-trunk-based-development-at-scale-real-world-insights-from-a-high-traffic-luxury-e-commerce-platform) (from "Trunk-Based Development at Scale: Real-World Insights from a High-Traffic Luxury E-Commerce Platform") - [Exploring the expansion of end-to-end testing utility suites](https://www.wearedevelopers.com/videos/1678-the-2025-state-of-javascript-testing) (from "The 2025 State of JavaScript Testing") - [Shifting development challenges towards complex testing and team collaboration](https://www.wearedevelopers.com/videos/1459-the-evolving-landscape-of-application-development-insights-from-three-years-of-research) (from "The Evolving Landscape of Application Development: Insights from Three Years of Research") ## Related Articles - [Liuba Gonta and Yuliya Khadasevic - GitHub Copilot Beyond the Basics - 10 Ways to Elevate Your Coding](https://www.wearedevelopers.com/magazine/490-liuba-gonta-and-yuliya-khadasevic-github-copilot-beyond-the-basics-10-ways-to-elevate-your-coding) - [Dev Digest 106 - DHH in HD](https://www.wearedevelopers.com/magazine/394-dev-digest-106-dhh-in-hd) - [Dev Digest 138 - Are you secure about this?](https://www.wearedevelopers.com/magazine/486-dev-digest-138-are-you-secure-about-this) - [All the videos of Halfstack London 2024!](https://www.wearedevelopers.com/magazine/521-all-the-videos-of-halfstack-london-2024) ## Related Jobs - [Software Tester (f/m/d)](https://www.wearedevelopers.com/jobs/44712-software-tester-f-m-d) at **Power Plus Communications** - [Software Tester](https://www.wearedevelopers.com/jobs/ext/1209689-software-tester) at **BWI GmbH** - [QA Automation Engineer](https://www.wearedevelopers.com/jobs/ext/1414297-qa-automation-engineer) at **Bitpanda** - [Softwaretester Embedded Linux Systems](https://www.wearedevelopers.com/jobs/ext/1432629-softwaretester-embedded-linux-systems) at **Power Plus Communications AG** - [Test Engineer](https://www.wearedevelopers.com/jobs/ext/1872489-test-engineer) at **ZEISS Group** - [Senior Data Engineer](https://www.wearedevelopers.com/jobs/ext/1589390-senior-data-engineer) at **Douglas GmbH**