:py:mod:`respy.conftest` ======================== .. py:module:: respy.conftest .. autoapi-nested-parse:: This module includes code to configure pytest. .. !! processed by numpydoc !! Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: respy.conftest._fresh_directory respy.conftest._patch_doctest_namespace respy.conftest.seed respy.conftest.pytest_addoption respy.conftest.pytest_generate_tests .. py:function:: _fresh_directory(tmp_path) Each test is executed in a fresh directory. .. !! processed by numpydoc !! .. py:function:: _patch_doctest_namespace(doctest_namespace) Patch the namespace for doctests. This function adds some packages to namespace of every doctest. .. !! processed by numpydoc !! .. py:function:: seed() Create placeholder value for function argument `seed` to be overwritten. .. !! processed by numpydoc !! .. py:function:: pytest_addoption(parser) Add a custom option to the pytest call. Simply use .. code-block:: bash $ pytest --n-random-tests=n to restrict running each random test with `n` increments of the base seed given by `pytest-randomly`. .. !! processed by numpydoc !! .. py:function:: pytest_generate_tests(metafunc) 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 .. code-block:: bash $ pytest --randomly-seed=5 Then, tests with certain parameter names are parameterized with incremented seed values (5, 6, 7, 8, ...). Existing parameterizations are extended. .. !! processed by numpydoc !!