logilab-pytest(1)
π logilab-pytest β run python unit tests π
okay bestie, so this is the logilab-pytest manual page, from the General Commands Manual section, and it's genuinely the cutest way to run your python unit tests. it's giving "test runner but make it yours". let's get into it. π§β¨
β¨ NAME β¨
logilab-pytest β run python unit tests
no cap, that's the whole vibe. it runs your tests. π
πΈ SYNOPSIS πΈ
usage: logilab-pytest [OPTIONS] [testfile [testpattern]]
and here are the examples, literally copy-paste-able:
logilab-pytest path/to/mytests.py
logilab-pytest path/to/mytests.py TheseTests
logilab-pytest path/to/mytests.py TheseTests.test_thisone
so like, you can point it at a whole file, or at a class inside the file, or at one single lil test method. main character energy at every level of specificity. π
logilab-pytest one (will run both test_thisone and test_thatone)
logilab-pytest path/to/mytests.py -s not (will skip test_notthisone)
not me using a test pattern and having it match multiple tests at once π β that's the first one. and the second one? you're naming a pattern to skip, so test_notthisone gets left on read.
logilab-pytest --coverage test_foo.py
π«Ά this one only works iflogilab.devtoolsis available. nologilab.devtools, no coverage, bestie. that's just how it is.
π OPTIONS π
the options section, aka the menu. every single one, no skips, we don't gatekeep here. β¨
-h,--helpβ show this help message and exit. the classic. the icon. ask it for help and it actually gives it. π-t TESTDIRβ directory where the tests will be found. point it at the spot, it'll go find your tests. π¦-dβ enable design-by-contract. yes, contracts, but for design. very serious, very demure. πΈ-v,--verboseβ Verbose output. it will tell you EVERYTHING. it will not be quiet. it's the friend who narrates their entire day. π-i,--pdbβ Enable test failure inspection. heads up: this conflicts with--coverageβ you literally cannot have both, pick a lane bestie. π-x,--exitfirstβ Exit on first failure. lowkey it only makes sense whenlogilab-pytestruns one test file, so don't come for it when it acts up in other setups. π-s SKIPPED,--skip=SKIPPEDβ test names matching this name will be skipped. wanna skip several patterns? use commas. one comma, many skips, we love efficiency. β¨-q,--quietβ Minimal output. the strong silent type. π-P PROFILE,--profile=PROFILEβ Profile execution and store data in the given file. so you can go "why is this slow" and get actual receipts. π₯--coverageβ run tests with pycoverage. heads up again: this conflicts with--pdb, so no, you cannot have your pdb moment AND your coverage moment at the same time. tragic. π
and that's the whole page, bestie β logilab-pytest, version from January 2008, living in the General Commands Manual section as logilab-pytest(1). go run your tests, you're gonna slay. πβπ
π¦ where this page comes from
- debian bookworm: python3-logilab-common 1.9.8-1 Β· LGPL-2.1-only
- debian trixie: python3-logilab-common 2.1.0-1 Β· LGPL-2.1-only
- ubuntu jammy: python3-logilab-common 1.8.2-1 Β· LGPL-2.1-only
- ubuntu noble: python3-logilab-common 1.9.8-2 Β· LGPL-2.1-only
- ubuntu questing: python3-logilab-common 2.1.0-1
- ubuntu resolute: python3-logilab-common 2.1.0-1build1 Β· LGPL-2.1-only
- ubuntu stonking: python3-logilab-common 2.1.0-2 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms