Do less work when testing your Python code but be just as expressive just as elegant & just as readable The pytest testing framework helps you write tests quickly & keep them readable & maintainable
- with no boilerplate code Using a robust yet simple fixture model it's just as easy to write small tests with pytest as it is to scale up to complex functional testing for applications packages & libraries This book shows you how For Python-based projects pytest is the undeniable choice to test your code if you're looking for a full-featured API-independent flexible & extensible testing framework With a full-bodied fixture model that is unmatched in any other tool the pytest framework gives you powerful features such as assert rewriting & plug-in capability
- with no boilerplate code With simple step-by-step instructions & sample code this book gets you up to speed quickly on this easy-to-learn & robust tool Write short maintainable tests that elegantly express what you're testing Add powerful testing features & still speed up test times by distributing tests across multiple processors & running tests in parallel Use the built-in assert statements to reduce false test failures by separating setup & test failures Test error conditions & corner cases with expected exception testing & use one test to run many test cases with parameterized testing Extend pytest with plugins connect it to continuous integration systems & use it in tandem with tox mock coverage unittest & doctest Write simple maintainable tests that elegantly express what you're testing & why What You Need The examples in this book are written using Python 36 & pytest 30 However pytest 30 supports Python 26 27 & Python 33-36