February 2022
Intermediate to advanced
274 pages
6h 28m
English
The sample Cards application is an installable Python package that is installed with pip install. Once it is installed, the test code can simply import cards to access the application’s capabilities, and test away. However, not all Python code is installable with pip, but still needs to be tested.
In this chapter, we’ll look at techniques for testing scripts and applications that cannot be installed with pip. To be clear on terms, the following definitions apply in this chapter:
A script is a single file containing Python code that is intended to be run directly from Python, such as python my_script.py.
An importable script is a script in which no code is executed when it is imported. Code is executed ...
Read now
Unlock full access