2017-07-20 08:11:17 +08:00
|
|
|
|
Configuration
|
|
|
|
|
=============
|
2009-08-19 01:04:57 +08:00
|
|
|
|
|
2010-11-01 00:41:58 +08:00
|
|
|
|
Command line options and configuration file settings
|
|
|
|
|
-----------------------------------------------------------------
|
2009-08-19 01:04:57 +08:00
|
|
|
|
|
2011-03-04 06:40:38 +08:00
|
|
|
|
You can get help on command line options and values in INI-style
|
|
|
|
|
configurations files by using the general help option::
|
2009-08-19 01:04:57 +08:00
|
|
|
|
|
2016-06-21 22:16:57 +08:00
|
|
|
|
pytest -h # prints options _and_ config file settings
|
2009-08-19 01:04:57 +08:00
|
|
|
|
|
2010-11-01 00:41:58 +08:00
|
|
|
|
This will display command line and configuration file settings
|
|
|
|
|
which were registered by installed plugins.
|
2009-08-19 01:04:57 +08:00
|
|
|
|
|
2015-02-27 04:56:44 +08:00
|
|
|
|
.. _rootdir:
|
2012-11-06 21:09:12 +08:00
|
|
|
|
.. _inifiles:
|
|
|
|
|
|
2017-07-20 08:11:17 +08:00
|
|
|
|
Initialization: determining rootdir and inifile
|
2015-02-27 04:56:44 +08:00
|
|
|
|
-----------------------------------------------
|
2010-11-25 19:11:10 +08:00
|
|
|
|
|
2015-02-27 04:56:44 +08:00
|
|
|
|
.. versionadded:: 2.7
|
2010-11-07 23:10:22 +08:00
|
|
|
|
|
2017-07-20 08:11:17 +08:00
|
|
|
|
pytest determines a ``rootdir`` for each test run which depends on
|
2015-02-27 04:56:44 +08:00
|
|
|
|
the command line arguments (specified test files, paths) and on
|
2017-07-20 08:11:17 +08:00
|
|
|
|
the existence of *ini-files*. The determined ``rootdir`` and *ini-file* are
|
|
|
|
|
printed as part of the pytest header during startup.
|
|
|
|
|
|
|
|
|
|
Here's a summary what ``pytest`` uses ``rootdir`` for:
|
|
|
|
|
|
|
|
|
|
* Construct *nodeids* during collection; each test is assigned
|
|
|
|
|
a unique *nodeid* which is rooted at the ``rootdir`` and takes in account full path,
|
|
|
|
|
class name, function name and parametrization (if any).
|
|
|
|
|
|
|
|
|
|
* Is used by plugins as a stable location to store project/test run specific information;
|
|
|
|
|
for example, the internal :ref:`cache <cache>` plugin creates a ``.cache`` subdirectory
|
|
|
|
|
in ``rootdir`` to store its cross-test run state.
|
|
|
|
|
|
|
|
|
|
Important to emphasize that ``rootdir`` is **NOT** used to modify ``sys.path``/``PYTHONPATH`` or
|
|
|
|
|
influence how modules are imported. See :ref:`pythonpath` for more details.
|
|
|
|
|
|
|
|
|
|
Finding the ``rootdir``
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~
|
2015-02-27 04:56:44 +08:00
|
|
|
|
|
|
|
|
|
Here is the algorithm which finds the rootdir from ``args``:
|
|
|
|
|
|
2016-06-22 03:48:59 +08:00
|
|
|
|
- determine the common ancestor directory for the specified ``args`` that are
|
|
|
|
|
recognised as paths that exist in the file system. If no such paths are
|
|
|
|
|
found, the common ancestor directory is set to the current working directory.
|
2015-02-27 04:56:44 +08:00
|
|
|
|
|
2016-06-22 03:48:59 +08:00
|
|
|
|
- look for ``pytest.ini``, ``tox.ini`` and ``setup.cfg`` files in the ancestor
|
|
|
|
|
directory and upwards. If one is matched, it becomes the ini-file and its
|
|
|
|
|
directory becomes the rootdir.
|
2015-02-27 04:56:44 +08:00
|
|
|
|
|
2016-06-22 03:48:59 +08:00
|
|
|
|
- if no ini-file was found, look for ``setup.py`` upwards from the common
|
|
|
|
|
ancestor directory to determine the ``rootdir``.
|
2015-02-27 04:56:44 +08:00
|
|
|
|
|
2016-06-22 03:48:59 +08:00
|
|
|
|
- if no ``setup.py`` was found, look for ``pytest.ini``, ``tox.ini`` and
|
|
|
|
|
``setup.cfg`` in each of the specified ``args`` and upwards. If one is
|
|
|
|
|
matched, it becomes the ini-file and its directory becomes the rootdir.
|
2015-02-27 04:56:44 +08:00
|
|
|
|
|
2016-06-22 03:48:59 +08:00
|
|
|
|
- if no ini-file was found, use the already determined common ancestor as root
|
2016-09-16 05:10:57 +08:00
|
|
|
|
directory. This allows the use of pytest in structures that are not part of
|
2016-06-22 03:48:59 +08:00
|
|
|
|
a package and don't have any particular ini-file configuration.
|
|
|
|
|
|
2016-08-19 15:01:12 +08:00
|
|
|
|
If no ``args`` are given, pytest collects test below the current working
|
2017-04-07 09:01:03 +08:00
|
|
|
|
directory and also starts determining the rootdir from there.
|
2016-08-19 15:01:12 +08:00
|
|
|
|
|
|
|
|
|
:warning: custom pytest plugin commandline arguments may include a path, as in
|
2016-08-19 20:02:25 +08:00
|
|
|
|
``pytest --log-output ../../test.log args``. Then ``args`` is mandatory,
|
2016-08-19 15:01:12 +08:00
|
|
|
|
otherwise pytest uses the folder of test.log for rootdir determination
|
|
|
|
|
(see also `issue 1435 <https://github.com/pytest-dev/pytest/issues/1435>`_).
|
|
|
|
|
A dot ``.`` for referencing to the current working directory is also
|
|
|
|
|
possible.
|
|
|
|
|
|
2016-06-22 03:48:59 +08:00
|
|
|
|
Note that an existing ``pytest.ini`` file will always be considered a match,
|
|
|
|
|
whereas ``tox.ini`` and ``setup.cfg`` will only match if they contain a
|
2016-08-17 08:30:07 +08:00
|
|
|
|
``[pytest]`` or ``[tool:pytest]`` section, respectively. Options from multiple ini-files candidates are never
|
2016-06-22 03:48:59 +08:00
|
|
|
|
merged - the first one wins (``pytest.ini`` always wins, even if it does not
|
2015-02-27 04:56:44 +08:00
|
|
|
|
contain a ``[pytest]`` section).
|
|
|
|
|
|
|
|
|
|
The ``config`` object will subsequently carry these attributes:
|
2010-11-07 23:10:22 +08:00
|
|
|
|
|
2015-02-27 04:56:44 +08:00
|
|
|
|
- ``config.rootdir``: the determined root directory, guaranteed to exist.
|
2010-10-28 01:35:27 +08:00
|
|
|
|
|
2015-02-27 04:56:44 +08:00
|
|
|
|
- ``config.inifile``: the determined ini-file, may be ``None``.
|
2010-10-28 01:35:27 +08:00
|
|
|
|
|
2015-02-27 04:56:44 +08:00
|
|
|
|
The rootdir is used a reference directory for constructing test
|
|
|
|
|
addresses ("nodeids") and can be used also by plugins for storing
|
|
|
|
|
per-testrun information.
|
2010-10-28 01:35:27 +08:00
|
|
|
|
|
2015-02-27 04:56:44 +08:00
|
|
|
|
Example::
|
|
|
|
|
|
2016-06-21 22:16:57 +08:00
|
|
|
|
pytest path/to/testdir path/other/
|
2015-02-27 04:56:44 +08:00
|
|
|
|
|
|
|
|
|
will determine the common ancestor as ``path`` and then
|
|
|
|
|
check for ini-files as follows::
|
|
|
|
|
|
|
|
|
|
# first look for pytest.ini files
|
|
|
|
|
path/pytest.ini
|
2016-08-17 08:30:07 +08:00
|
|
|
|
path/setup.cfg # must also contain [tool:pytest] section to match
|
2015-02-27 04:56:44 +08:00
|
|
|
|
path/tox.ini # must also contain [pytest] section to match
|
|
|
|
|
pytest.ini
|
|
|
|
|
... # all the way down to the root
|
|
|
|
|
|
|
|
|
|
# now look for setup.py
|
|
|
|
|
path/setup.py
|
|
|
|
|
setup.py
|
|
|
|
|
... # all the way down to the root
|
2010-10-28 01:35:27 +08:00
|
|
|
|
|
|
|
|
|
|
2010-11-25 19:11:10 +08:00
|
|
|
|
.. _`how to change command line options defaults`:
|
|
|
|
|
.. _`adding default options`:
|
|
|
|
|
|
2016-09-16 05:10:57 +08:00
|
|
|
|
|
2016-09-16 01:46:15 +08:00
|
|
|
|
|
2011-03-04 06:40:38 +08:00
|
|
|
|
How to change command line options defaults
|
2010-11-25 19:11:10 +08:00
|
|
|
|
------------------------------------------------
|
|
|
|
|
|
2011-03-04 06:40:38 +08:00
|
|
|
|
It can be tedious to type the same series of command line options
|
2014-01-18 19:31:33 +08:00
|
|
|
|
every time you use ``pytest``. For example, if you always want to see
|
2011-03-04 06:40:38 +08:00
|
|
|
|
detailed info on skipped and xfailed tests, as well as have terser "dot"
|
2015-07-10 08:50:38 +08:00
|
|
|
|
progress output, you can write it into a configuration file:
|
|
|
|
|
|
|
|
|
|
.. code-block:: ini
|
2010-11-25 19:11:10 +08:00
|
|
|
|
|
|
|
|
|
# content of pytest.ini
|
|
|
|
|
# (or tox.ini or setup.cfg)
|
|
|
|
|
[pytest]
|
2017-07-19 02:37:01 +08:00
|
|
|
|
addopts = -ra -q
|
2010-11-25 19:11:10 +08:00
|
|
|
|
|
2017-07-19 02:37:01 +08:00
|
|
|
|
Alternatively, you can set a ``PYTEST_ADDOPTS`` environment variable to add command
|
2015-02-09 22:11:54 +08:00
|
|
|
|
line options while the environment is in use::
|
|
|
|
|
|
2017-07-19 02:37:01 +08:00
|
|
|
|
export PYTEST_ADDOPTS="-v"
|
2015-02-09 22:11:54 +08:00
|
|
|
|
|
2017-07-19 02:37:01 +08:00
|
|
|
|
Here's how the command-line is built in the presence of ``addopts`` or the environment variable::
|
2010-11-25 19:11:10 +08:00
|
|
|
|
|
2017-07-19 02:37:01 +08:00
|
|
|
|
<pytest.ini:addopts> $PYTEST_ADDOTPS <extra command-line arguments>
|
|
|
|
|
|
|
|
|
|
So if the user executes in the command-line::
|
|
|
|
|
|
|
|
|
|
pytest -m slow
|
|
|
|
|
|
|
|
|
|
The actual command line executed is::
|
|
|
|
|
|
|
|
|
|
pytest -ra -q -v -m slow
|
|
|
|
|
|
|
|
|
|
Note that as usual for other command-line applications, in case of conflicting options the last one wins, so the example
|
|
|
|
|
above will show verbose output because ``-v`` overwrites ``-q``.
|
2015-02-27 04:56:44 +08:00
|
|
|
|
|
|
|
|
|
|
2011-09-06 17:43:42 +08:00
|
|
|
|
Builtin configuration file options
|
2010-11-01 00:41:58 +08:00
|
|
|
|
----------------------------------------------
|
2010-10-28 01:35:27 +08:00
|
|
|
|
|
2018-01-24 07:13:20 +08:00
|
|
|
|
Here is a list of builtin configuration options that may be written in a ``pytest.ini``, ``tox.ini`` or ``setup.cfg``
|
|
|
|
|
file, usually located at the root of your repository. All options must be under a ``[pytest]`` section
|
|
|
|
|
(``[tool:pytest]`` for ``setup.cfg`` files).
|
|
|
|
|
|
|
|
|
|
Configuration file options may be overwritten in the command-line by using ``-o/--override``, which can also be
|
|
|
|
|
passed multiple times. The expected format is ``name=value``. For example::
|
|
|
|
|
|
|
|
|
|
pytest -o console_output_style=classic -o cache_dir=/tmp/mycache
|
|
|
|
|
|
|
|
|
|
|
2010-11-06 06:37:25 +08:00
|
|
|
|
.. confval:: minversion
|
2010-10-28 01:35:27 +08:00
|
|
|
|
|
2011-12-05 18:10:48 +08:00
|
|
|
|
Specifies a minimal pytest version required for running tests.
|
2009-08-19 01:04:57 +08:00
|
|
|
|
|
2018-01-24 07:13:20 +08:00
|
|
|
|
.. code-block:: ini
|
|
|
|
|
|
|
|
|
|
# content of pytest.ini
|
|
|
|
|
[pytest]
|
|
|
|
|
minversion = 3.0 # will fail if we run with pytest-2.8
|
2009-08-19 01:04:57 +08:00
|
|
|
|
|
2010-11-06 06:37:25 +08:00
|
|
|
|
.. confval:: addopts
|
2009-08-19 01:04:57 +08:00
|
|
|
|
|
2011-12-05 18:10:48 +08:00
|
|
|
|
Add the specified ``OPTS`` to the set of command line arguments as if they
|
2015-07-10 08:50:38 +08:00
|
|
|
|
had been specified by the user. Example: if you have this ini file content:
|
|
|
|
|
|
|
|
|
|
.. code-block:: ini
|
2009-08-19 01:04:57 +08:00
|
|
|
|
|
2018-01-24 07:13:20 +08:00
|
|
|
|
# content of pytest.ini
|
2015-07-10 08:50:38 +08:00
|
|
|
|
[pytest]
|
|
|
|
|
addopts = --maxfail=2 -rf # exit after 2 failures, report fail info
|
2009-08-19 01:04:57 +08:00
|
|
|
|
|
2016-06-21 22:16:57 +08:00
|
|
|
|
issuing ``pytest test_hello.py`` actually means::
|
2009-08-19 21:45:01 +08:00
|
|
|
|
|
2016-06-21 22:16:57 +08:00
|
|
|
|
pytest --maxfail=2 -rf test_hello.py
|
2009-08-19 01:04:57 +08:00
|
|
|
|
|
2010-11-06 06:37:25 +08:00
|
|
|
|
Default is to add no options.
|
|
|
|
|
|
|
|
|
|
.. confval:: norecursedirs
|
|
|
|
|
|
|
|
|
|
Set the directory basename patterns to avoid when recursing
|
2010-11-06 06:37:31 +08:00
|
|
|
|
for test discovery. The individual (fnmatch-style) patterns are
|
|
|
|
|
applied to the basename of a directory to decide if to recurse into it.
|
2010-11-06 06:37:25 +08:00
|
|
|
|
Pattern matching characters::
|
|
|
|
|
|
|
|
|
|
* matches everything
|
|
|
|
|
? matches any single character
|
|
|
|
|
[seq] matches any character in seq
|
|
|
|
|
[!seq] matches any char not in seq
|
|
|
|
|
|
2017-02-15 21:55:12 +08:00
|
|
|
|
Default patterns are ``'.*', 'build', 'dist', 'CVS', '_darcs', '{arch}', '*.egg', 'venv'``.
|
2014-07-03 22:49:03 +08:00
|
|
|
|
Setting a ``norecursedirs`` replaces the default. Here is an example of
|
2015-07-10 08:50:38 +08:00
|
|
|
|
how to avoid certain directories:
|
2010-11-06 06:37:25 +08:00
|
|
|
|
|
2015-07-10 08:50:38 +08:00
|
|
|
|
.. code-block:: ini
|
|
|
|
|
|
2016-08-17 08:30:07 +08:00
|
|
|
|
# content of pytest.ini
|
2015-07-10 08:50:38 +08:00
|
|
|
|
[pytest]
|
|
|
|
|
norecursedirs = .svn _build tmp*
|
2010-11-06 06:37:25 +08:00
|
|
|
|
|
2014-01-18 19:31:33 +08:00
|
|
|
|
This would tell ``pytest`` to not look into typical subversion or
|
2017-07-12 12:14:38 +08:00
|
|
|
|
sphinx-build directories or into any ``tmp`` prefixed directory.
|
|
|
|
|
|
|
|
|
|
Additionally, ``pytest`` will attempt to intelligently identify and ignore a
|
|
|
|
|
virtualenv by the presence of an activation script. Any directory deemed to
|
|
|
|
|
be the root of a virtual environment will not be considered during test
|
|
|
|
|
collection unless ``‑‑collect‑in‑virtualenv`` is given. Note also that
|
|
|
|
|
``norecursedirs`` takes precedence over ``‑‑collect‑in‑virtualenv``; e.g. if
|
|
|
|
|
you intend to run tests in a virtualenv with a base directory that matches
|
|
|
|
|
``'.*'`` you *must* override ``norecursedirs`` in addition to using the
|
|
|
|
|
``‑‑collect‑in‑virtualenv`` flag.
|
2010-10-14 00:45:07 +08:00
|
|
|
|
|
2015-07-09 09:51:18 +08:00
|
|
|
|
.. confval:: testpaths
|
|
|
|
|
|
|
|
|
|
.. versionadded:: 2.8
|
|
|
|
|
|
|
|
|
|
Sets list of directories that should be searched for tests when
|
2015-12-03 11:01:34 +08:00
|
|
|
|
no specific directories, files or test ids are given in the command line when
|
2015-07-09 09:51:18 +08:00
|
|
|
|
executing pytest from the :ref:`rootdir <rootdir>` directory.
|
|
|
|
|
Useful when all project tests are in a known location to speed up
|
|
|
|
|
test collection and to avoid picking up undesired tests by accident.
|
|
|
|
|
|
|
|
|
|
.. code-block:: ini
|
|
|
|
|
|
|
|
|
|
# content of pytest.ini
|
|
|
|
|
[pytest]
|
|
|
|
|
testpaths = testing doc
|
|
|
|
|
|
|
|
|
|
This tells pytest to only look for tests in ``testing`` and ``doc``
|
|
|
|
|
directories when executing from the root directory.
|
|
|
|
|
|
2010-11-25 19:11:10 +08:00
|
|
|
|
.. confval:: python_files
|
|
|
|
|
|
|
|
|
|
One or more Glob-style file patterns determining which python files
|
2017-08-12 18:21:29 +08:00
|
|
|
|
are considered as test modules. By default, pytest will consider
|
|
|
|
|
any file matching with ``test_*.py`` and ``*_test.py`` globs as a test
|
|
|
|
|
module.
|
2010-11-25 19:11:10 +08:00
|
|
|
|
|
|
|
|
|
.. confval:: python_classes
|
|
|
|
|
|
2014-10-17 06:27:10 +08:00
|
|
|
|
One or more name prefixes or glob-style patterns determining which classes
|
2017-08-12 18:21:29 +08:00
|
|
|
|
are considered for test collection. By default, pytest will consider any
|
|
|
|
|
class prefixed with ``Test`` as a test collection. Here is an example of how
|
|
|
|
|
to collect tests from classes that end in ``Suite``:
|
2014-10-17 06:27:10 +08:00
|
|
|
|
|
2015-07-10 08:50:38 +08:00
|
|
|
|
.. code-block:: ini
|
|
|
|
|
|
|
|
|
|
# content of pytest.ini
|
|
|
|
|
[pytest]
|
|
|
|
|
python_classes = *Suite
|
2014-10-17 06:27:10 +08:00
|
|
|
|
|
|
|
|
|
Note that ``unittest.TestCase`` derived classes are always collected
|
|
|
|
|
regardless of this option, as ``unittest``'s own collection framework is used
|
|
|
|
|
to collect those tests.
|
2010-11-25 05:01:04 +08:00
|
|
|
|
|
2010-11-25 19:11:10 +08:00
|
|
|
|
.. confval:: python_functions
|
2010-11-25 05:01:04 +08:00
|
|
|
|
|
2014-10-17 06:27:10 +08:00
|
|
|
|
One or more name prefixes or glob-patterns determining which test functions
|
2017-08-12 18:21:29 +08:00
|
|
|
|
and methods are considered tests. By default, pytest will consider any
|
|
|
|
|
function prefixed with ``test`` as a test. Here is an example of how
|
2015-07-10 08:50:38 +08:00
|
|
|
|
to collect test functions and methods that end in ``_test``:
|
2014-10-17 06:27:10 +08:00
|
|
|
|
|
2015-07-10 08:50:38 +08:00
|
|
|
|
.. code-block:: ini
|
|
|
|
|
|
|
|
|
|
# content of pytest.ini
|
|
|
|
|
[pytest]
|
|
|
|
|
python_functions = *_test
|
2014-10-17 06:27:10 +08:00
|
|
|
|
|
|
|
|
|
Note that this has no effect on methods that live on a ``unittest
|
|
|
|
|
.TestCase`` derived class, as ``unittest``'s own collection framework is used
|
|
|
|
|
to collect those tests.
|
2010-11-25 05:01:04 +08:00
|
|
|
|
|
2014-10-17 06:27:10 +08:00
|
|
|
|
See :ref:`change naming conventions` for more detailed examples.
|
2014-10-08 21:48:41 +08:00
|
|
|
|
|
|
|
|
|
.. confval:: doctest_optionflags
|
|
|
|
|
|
|
|
|
|
One or more doctest flag names from the standard ``doctest`` module.
|
2016-06-21 22:16:57 +08:00
|
|
|
|
:doc:`See how pytest handles doctests <doctest>`.
|
2015-07-24 08:48:59 +08:00
|
|
|
|
|
|
|
|
|
.. confval:: confcutdir
|
|
|
|
|
|
|
|
|
|
Sets a directory where search upwards for ``conftest.py`` files stops.
|
|
|
|
|
By default, pytest will stop searching for ``conftest.py`` files upwards
|
|
|
|
|
from ``pytest.ini``/``tox.ini``/``setup.cfg`` of the project if any,
|
|
|
|
|
or up to the file-system root.
|
2017-03-21 10:35:01 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. confval:: filterwarnings
|
|
|
|
|
|
|
|
|
|
.. versionadded:: 3.1
|
|
|
|
|
|
|
|
|
|
Sets a list of filters and actions that should be taken for matched
|
|
|
|
|
warnings. By default all warnings emitted during the test session
|
|
|
|
|
will be displayed in a summary at the end of the test session.
|
|
|
|
|
|
|
|
|
|
.. code-block:: ini
|
|
|
|
|
|
|
|
|
|
# content of pytest.ini
|
|
|
|
|
[pytest]
|
|
|
|
|
filterwarnings =
|
|
|
|
|
error
|
|
|
|
|
ignore::DeprecationWarning
|
|
|
|
|
|
|
|
|
|
This tells pytest to ignore deprecation warnings and turn all other warnings
|
|
|
|
|
into errors. For more information please refer to :ref:`warnings`.
|
2017-07-07 18:08:12 +08:00
|
|
|
|
|
|
|
|
|
.. confval:: cache_dir
|
|
|
|
|
|
|
|
|
|
.. versionadded:: 3.2
|
|
|
|
|
|
|
|
|
|
Sets a directory where stores content of cache plugin. Default directory is
|
|
|
|
|
``.cache`` which is created in :ref:`rootdir <rootdir>`. Directory may be
|
|
|
|
|
relative or absolute path. If setting relative path, then directory is created
|
|
|
|
|
relative to :ref:`rootdir <rootdir>`. Additionally path may contain environment
|
|
|
|
|
variables, that will be expanded. For more information about cache plugin
|
|
|
|
|
please refer to :ref:`cache_provider`.
|
2017-11-22 06:43:12 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. confval:: console_output_style
|
|
|
|
|
|
|
|
|
|
.. versionadded:: 3.3
|
|
|
|
|
|
|
|
|
|
Sets the console output style while running tests:
|
|
|
|
|
|
|
|
|
|
* ``classic``: classic pytest output.
|
|
|
|
|
* ``progress``: like classic pytest output, but with a progress indicator.
|
|
|
|
|
|
|
|
|
|
The default is ``progress``, but you can fallback to ``classic`` if you prefer or
|
|
|
|
|
the new mode is causing unexpected problems:
|
|
|
|
|
|
|
|
|
|
.. code-block:: ini
|
|
|
|
|
|
|
|
|
|
# content of pytest.ini
|
|
|
|
|
[pytest]
|
|
|
|
|
console_output_style = classic
|
2018-01-26 18:26:48 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. confval:: empty_parameterset
|
|
|
|
|
|
|
|
|
|
.. versionadded:: 3.4
|
|
|
|
|
|
|
|
|
|
allows to pick the action for empty parametersets in parameterization
|
|
|
|
|
|
|
|
|
|
* ``skip`` skips tests with a empty parameterset
|
|
|
|
|
* ``xfail`` marks tests with a empty parameterset as xfail(run=False)
|
|
|
|
|
|
|
|
|
|
The default is ``skip``, it will be shifted to xfail in future.
|
|
|
|
|
|
|
|
|
|
.. code-block:: ini
|
|
|
|
|
|
|
|
|
|
# content of pytest.ini
|
|
|
|
|
[pytest]
|
|
|
|
|
empty_parameterset = xfail
|