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 if logilab.devtools is available. no logilab.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 when logilab-pytest runs 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. πŸŒˆβ­πŸ’œ