Skip to main content

Short Introduction to pytest

  • Chapter
  • First Online:
Python Challenges
  • 3366 Accesses

Abstract

pytest is a framework written in Python that helps in creating and automating test cases. It is easy to learn and takes a lot of the work out of writing and managing test cases. In particular, only the logic for the test cases itself needs to be implemented. Unlike some other frameworks, there is no need to learn a large number of functions to set up test assertions; one is enough.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    If the number of values is huge, it is not a good idea to perform a check for all of them, since this often significantly increases the execution time of the unit tests, without providing any real added value. Especially here, it is recommended to use representatives from equivalence classes, which should drastically reduce the number of test cases. For details, refer to my book Der Weg zum Java-Profi [Ind20].

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2022 The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Inden, M. (2022). Short Introduction to pytest. In: Python Challenges. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-7398-2_11

Download citation

Publish with us

Policies and ethics