February 22, 2022
Python Testing with pytest, Second Edition: Simple, Rapid, Effective, and Scalable
pytest is undeniably the best choice for testing Python projects. It's a full-featured, flexible, and extensible testing framework. pytest's fixture model allows you to share test data and setup procedures across multiple layers of tests. The pytest framework gives you powerful features such as assert rewriting, parametrization, markers, plugins, parallel test execution, and clear test failure reporting—with no boilerplate code.
With simple step-by-step instructions and sample code, this book gets you up to speed quickly on this easy-to-learn yet powerful tool. Write short, maintainable tests that elegantly express what you're testing. Speed up test times by distributing tests across multiple processors and running tests in parallel. Use Python's built-in assert statements instead of awkward assert helper functions to make your tests more readable. Move setup code out of tests and into fixtures to separate setup failures from test failures. Test error conditions and corner cases with expected exception testing, and use one test to run many test cases with parameterized testing. Extend pytest with plugins, connect it to continuous integration systems, and use it in tandem with tox, mock, coverage, and even existing unittest tests.
Write simple, maintainable tests quickly with pytest.
Now in print: Use coupon code "BOPYTEST2COMPLETE" for 40% off the ebook at pragprog.com/titles/bopytest2. For the paperback edition, please support your local independent bookstore.
You Could Be a Published Author
Is there a tech topic you are deeply passionate about and want to share with the rest of us? You could become a published Pragmatic Bookshelf author! Take a look at our pragprog.com/become-an-author page for details, including our 50% royalty (yes, for real!) and world-class development editors.
Remember, the best way to tell the future is to create it.
Upcoming Author Appearances2022-03-17 Ben Cotton,
FOSS Backstage
2022-04-06 Frances Buontempo,
ACCU Conf 2022 (UK and online)
Don't Get Left Out
Are your friends jealous that you get these spiffy email newsletters and they don't? Clue them in that all they need to do is sign up at pragprog.com.
Tell your friends! Tweet this
Follow us on Twitter for the latest news, commentary, and occasional discounts: @pragprog, Andy Hunt @PragmaticAndy.
Thanks for your continued support,
By Professional Developers, for Professional Developers PragProg.com
Sent by the Pragmatic Programmers, LLC. • 9650 Strickland Rd Ste 103-255• Raleigh NC 27615
|