Python Notes and Examples


To use PyTest, install via apt install python3-pytest.

Pytest finds and runs test_ functions in your source files. Put your tests into “test_{module-name}.py” files. You write assert statements in them.

Example, in the my-proj directory:

~/dev/my-proj$ tree
├── my_proj/
│   ├──
│   └──

my_proj/ looks like:

and looks like:

Run all test from the top-level of the project directory like so: