Easier migration of unittest-based tests to pytest with fixtures
Load plugins dynamically by passing plugins
to pytest.main()
set ids by using a str
value or generate them with a callable or the
pytest_make_parametrize_id
hook.
Defer setup code and invoke fixtures from @pytest.mark.parametrize
with indirect
.
Use pytest_pycollect_makeitem
to customize how tests are collected
from classes
Run pytest with -rw
CLI flag to show internal warnings
Combine options -x
, -l
, --lf
and --tb=long
to analyze
results. Drop to the built-in debugger with --pdb
.
Use @pytest.fixture(params=[1, 2])
or @pytest.mark.parametrize('a, b', [(1, 2), (3, 4)])
to create multiple tests
Use request.config.slaveinput
to send information from master to worker nodes in pytest-xdist
Use the pytest_collection_modifyitems
hook to select only tests that use a certain fixture