pytest

Langue: en

Version: 262616 (debian - 07/07/09)

Section: 1 (Commandes utilisateur)

NAME

pytest - run python unit tests

SYNOPSIS

usage: pytest [OPTIONS] [testfile [testpattern]]

examples:

pytest path/to/mytests.py pytest path/to/mytests.py TheseTests pytest path/to/mytests.py TheseTests.test_thisone

pytest one (will run both test_thisone and test_thatone) pytest path/to/mytests.py -s not (will skip test_notthisone)

pytest --coverage test_foo.py

(only if logilab.devtools is available)

options:

-h, --help
show this help message and exit
-t TESTDIR
directory where the tests will be found
-d
enable design-by-contract
-v, --verbose
Verbose output
-i, --pdb
Enable test failure inspection (conflicts with --coverage)
-x, --exitfirst
Exit on first failure (only make sense when pytest run one test file)
-c, --capture
Captures and prints standard out/err only on errors (only make sense when pytest run one test file)
-p PRINTONLY, --printonly=PRINTONLY
Only prints lines matching specified pattern (implies capture) (only make sense when pytest run one test file)
-s SKIPPED, --skip=SKIPPED
test names matching this name will be skipped to skip several patterns, use commas
-q, --quiet
Minimal output
-P PROFILE, --profile=PROFILE
Profile execution and store data in the given file
--coverage
run tests with pycoverage (conflicts with --pdb)