February 2022
Intermediate to advanced
274 pages
6h 28m
English
Up to now we’ve had the cards_proj code in one directory and the tests in our chapter directories. Now we’ll combine them into one project and add a tox.ini file.
Here’s the abbreviated code layout:
| | cards_proj |
| | ├── LICENSE |
| | ├── README.md |
| | ├── pyproject.toml |
| | ├── pytest.ini |
| | ├── src |
| | │ └── cards |
| | │ └── ... |
| | ├── tests |
| | │ ├── api |
| | │ │ └── ... |
| | │ └── cli |
| | │ └── ... |
| | └── tox.ini |
You can explore the full project at /path/to/code/ch11/cards_proj. This is a typical layout for many package projects.
Let’s take a look at a basic tox.ini file in the Cards project:
| | [tox] |
| | envlist = py310 |
| | isolated_build = True |
| | |
| | [testenv] |
| | deps = |
| | pytest |
| | faker |
| | commands = pytest |
Under [tox], we ...
Read now
Unlock full access