Python Testing with pytest, 2nd Edition

Simple, Rapid, Effective, and Scalable



Bookstore > Books > Python Testing with pytest, 2nd Edition

Price$41.99 - $47.93
Rating
AuthorBrian Okken
PublisherThe Pragmatic Programmers
Published2022
Pages272
LanguageEnglish
FormatPaper book / ebook (PDF)
ISBN-101680508601
ISBN-139781680508604
EBook Hardcover Paperback

Test applications, packages, and libraries large and small with pytest, Python's most powerful testing framework. pytest helps you write tests quickly and keep them readable and maintainable. In this fully revised edition, explore pytest's superpowers - simple asserts, fixtures, parametrization, markers, and plugins - while creating simple tests and test suites against a small database application. 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. This book shows you how.

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.


  1. (2 books)


5 5 231

Similar Books


Java Persistence with Hibernate, 2nd Edition

Java Persistence with Hibernate, 2nd Edition

by Christian Bauer, Gavin King, Gary Gregory

Java Persistence with Hibernate, 2nd Edition explores Hibernate by developing an application that ties together hundreds of individual examples. You'll immediately dig into the rich programming model of Hibernate, working through mappings, queries, fetching strategies, transactions, conversations, caching, and more. Along the way you...

Price:  $39.99  |  Publisher:  Manning  |  Release:  2015

Angular Development with Typescript, 2nd Edition

Angular Development with Typescript, 2nd Edition

by Yakov Fain, Anton Moiseev

Angular Development with TypeScript, 2nd Edition is an intermediate-level tutorial that introduces Angular and TypeScript to developers comfortable with building web applications using other frameworks and tools.Whether you're building lightweight web clients or full-featured SPAs, Angular is a clear choice. The Angular framework is ...

Price:  $39.99  |  Publisher:  Manning  |  Release:  2018

Practical Data Science with R, 2nd Edition

Practical Data Science with R, 2nd Edition

by Nina Zumel, John Mount

Practical Data Science with R, Second Edition takes a practice-oriented approach to explaining basic principles in the ever expanding field of data science. You'll jump right to real-world use cases as you apply the R programming language and statistical analysis techniques to carefully explained examples based in marketing, business...

Price:  $39.99  |  Publisher:  Manning  |  Release:  2019

Spring Persistence with Hibernate, 2nd Edition

Spring Persistence with Hibernate, 2nd Edition

by Brian D. Murphy, Paul Fisher

Learn how to use the core Hibernate APIs and tools as part of the Spring Framework. This book illustrates how these two frameworks can be best utilized. Other persistence solutions available in Spring are also shown including the Java Persistence API (JPA).Spring Persistence with Hibernate, Second Edition has been updated to cover Spring ...

Price:  $33.19  |  Publisher:  Apress  |  Release:  2016

Python Unit Test Automation, 2nd Edition

Python Unit Test Automation, 2nd Edition

by Ashwin Pajankar

Learn how to automate unit tests of Python 3 with automation libraries, such as doctest, unittest, nose, nose2, pytest, and selenium. This book explores important concepts in software test automation and demonstrates how to automate, organize, and execute unit tests with Python. It also introduces readers to the concepts of web browser au...

Price:  $39.89  |  Publisher:  Apress  |  Release:  2022

Python Testing with pytest

Python Testing with pytest

by Brian Okken

For Python-based projects, pytest is the undeniable choice to test your code if you're looking for a full-featured, API-independent, flexible, and 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 and plug-in ca...

Price:  $30.54  |  Publisher:  The Pragmatic Programmers  |  Release:  2017

Writing Excel Macros with VBA, 2nd Edition

Writing Excel Macros with VBA, 2nd Edition

by Steven Roman, PhD

To achieve the maximum control and flexibility from Microsoft Excel often requires careful custom programming using the VBA (Visual Basic for Applications) language. Writing Excel Macros with VBA, 2nd Edition offers a solid introduction to writing VBA macros and programs, and will show you how to get more power at the programming level: f...

Price:  $4.84  |  Publisher:  O'Reilly Media  |  Release:  2002

Deep Learning with R, 2nd Edition

Deep Learning with R, 2nd Edition

by Francois Chollet, Tomasz Kalinowski, J. J. Allaire

Deep Learning with R, 2nd Edition shows you how to put deep learning into action. It's based on the revised new edition of François Chollet's bestselling Deep Learning with Python. All code and examples have been expertly translated to the R language by Tomasz Kalinowski, who maintains the Keras and Tensorflow R packages at RSt...

Price:  $59.99  |  Publisher:  Manning  |  Release:  2022