Skip to Main Content
Python Testing with pytest
book

Python Testing with pytest

by Brian Okken
February 2022
Intermediate to advanced content levelIntermediate to advanced
274 pages
6h 28m
English
Pragmatic Bookshelf
Content preview from Python Testing with pytest

Testing requirements.txt-Based Applications

A script or application may have dependencies—other projects that need to be installed before the script or application can run. A packaged project like Cards has a list of dependencies defined in either a pyproject.toml, setup.py, or setup.cfg file. Cards uses pyproject.toml. However, many projects don’t use packaging, and instead define dependencies in a requirements.txt file.

The dependency list in a requirements.txt file could be just a list of loose dependencies, like:

 typer
 requests

However, it’s more common for applications to “pin” dependencies by defining specific versions that are known to work:

 typer==0.3.2
 requests==2.26.0 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python Testing with pytest

Python Testing with pytest

Brian Okken

Publisher Resources

ISBN: 9781680509427Errata Page