respy.conftest
#
This module includes code to configure pytest.
Module Contents#
Functions#
|
Each test is executed in a fresh directory. |
|
Patch the namespace for doctests. |
|
Create placeholder value for function argument seed to be overwritten. |
|
Add a custom option to the pytest call. |
|
Re-run some tests with different seeds by incrementing the base seed. |
- respy.conftest._patch_doctest_namespace(doctest_namespace)[source]#
Patch the namespace for doctests.
This function adds some packages to namespace of every doctest.
- respy.conftest.seed()[source]#
Create placeholder value for function argument seed to be overwritten.
- respy.conftest.pytest_addoption(parser)[source]#
Add a custom option to the pytest call.
Simply use
$ pytest --n-random-tests=n
to restrict running each random test with n increments of the base seed given by pytest-randomly.
- respy.conftest.pytest_generate_tests(metafunc)[source]#
Re-run some tests with different seeds by incrementing the base seed.
The base seed is given by pytest-randomly in each session derived from the timestamp. You can use five as the seed value with
$ pytest --randomly-seed=5
Then, tests with certain parameter names are parameterized with incremented seed values (5, 6, 7, 8, …). Existing parameterizations are extended.