latest--partial-pytest
shared| Type | LegacyConfig | Config |
|---|---|
| Schema URL | https://catalog.lintel.tools/schemas/schemastore/pyproject/_shared/latest--partial-pytest.json |
| Parent schema | pyproject |
JSON schema for pytest configuration options under [tool.pytest] in pyproject.toml.
One of
Definitions
Legacy configuration using ini_options table (pytest <9)
The ini_options table is used as a bridge between the existing pytest.ini configuration system and future configuration formats. pytest.ini takes precedence over [tool.pytest.ini_options] in pyproject.toml.
Add the specified OPTS to the set of command line arguments as if they had been specified by the user.
Sets the directory where the cache plugin's content is stored.
Settings this to false will make pytest collect classes/functions from test files only if they are defined in that file (as opposed to imported there).
Controls if pytest should attempt to identify namespace packages when collecting Python modules.
Sets console output style during test execution.
pytest by default escapes any non-ascii characters used in unicode strings for the parametrization because it has several downsides. If however you would like to use unicode strings in parametrization and see them in the terminal as is (non-escaped), use this option in your configuration file
Default encoding to use to decode text files with docstrings.
One or more doctest flag names from the standard doctest module.
Allows to pick the action for empty parametersets in parameterization.
Enables the pytest_assertion_pass hook. Make sure to delete any previously generated .pyc cache files.
Exit the pytest process after the per-test timeout is reached by passing exit=True to the faulthandler.dump_traceback_later() function. This is particularly useful to avoid wasting CI resources for test suites that are prone to putting the main Python interpreter into a deadlock state.
Dumps the tracebacks of all threads if a test takes longer than X seconds to run (including fixture setup and teardown). Implemented using the faulthandler.dump_traceback_later() function, so all caveats there apply.
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.
Configures how durations are recorded into the JUnit XML report:
Configures the format of the generated JUnit XML file.
If junit_logging is enabled, configures if the captured output should be written to the JUnit XML file for passing tests.
Configures if captured output should be written to the JUnit XML file.
To set the name of the root test suite xml item, you can configure the junit_suite_name option in your config file.
Allow selective auto-indentation of multiline log messages.
Enable log display during test run (also known as "live logging").
Sets a time.strftime()-compatible string that will be used when formatting dates for live logging.
Sets a logging-compatible string used to format live logging messages.
A minimum log level. Can be level name or integer value.
Sets a time.strftime()-compatible string that will be used when formatting dates for logging capture.
Sets a file name relative to the current working directory where log messages should be written to, in addition to the other logging facilities that are active.
Sets a time.strftime()-compatible string that will be used when formatting dates for the logging file.
Sets a logging-compatible string used to format logging messages redirected to the logging file.
A minimum log level. Can be level name or integer value.
Sets the mode that the logging file is opened with. The options are 'w' to recreate the file (the default) or 'a' to append to the file.
Sets a logging-compatible string used to format captured logging messages.
A minimum log level. Can be level name or integer value.
When the strict_markers configuration option is set, only known markers - defined in code by core pytest or some plugin - are allowed. You can list additional markers in this setting to add them to the whitelist, in which case you probably want to set strict_markers to true to avoid future regressions.
Specifies a minimal pytest version required for running tests.
Set the directory basename patterns to avoid when recursing for test discovery. The individual (fnmatch-style) patterns are applied to the basename of a directory to decide if to recurse into it.
One or more name prefixes or glob-style patterns determining which classes are considered for test collection. Search for multiple glob patterns by adding a space between patterns. By default, pytest will consider any class prefixed with Test as a test collection.
One or more Glob-style file patterns determining which python files are considered as test modules.
[
"test_*.py",
"*_test.py"
]
One or more name prefixes or glob-patterns determining which test functions and methods are considered tests. Search for multiple glob patterns by adding a space between patterns. By default, pytest will consider any function prefixed with test as a test.
[
"test_*"
]
Sets list of directories that should be added to the python search path. Directories will be added to the head of sys.path. Similar to the PYTHONPATH environment variable, the directories will be included in where Python will look for imported modules. Paths are relative to the rootdir directory.
A list of plugins that must be present for pytest to run. Plugins can be listed with or without version specifiers directly following their name.
If set to true, enable 'strict mode', which enables a number of other strict options.
If set to true, any warnings encountered while parsing the pytest section of the configuration file will raise errors.
If set to true, markers not registered in the markers section of the configuration file will raise errors.
If set to true, pytest emits an error if it detects non-unique parameter set IDs. If not set (the default), pytest automatically handles this by adding 0, 1, … to duplicate IDs, making them unique.
If set to true, tests marked with @pytest.mark.xfail that actually succeed will by default fail the test suite.
Sets list of directories that should be searched for tests when no specific directories, files or test ids are given in the command line when executing pytest from the rootdir directory. File system paths may use shell-style wildcards, including the recursive ** pattern. Useful when all project tests are in a known location to speed up test collection and to avoid picking up undesired tests by accident.
How many sessions should we keep the tmp_path directories, according to tmp_path_retention_policy.
Controls which directories created by the tmp_path fixture are kept around, based on test outcome.
Controls maximum number of characters to truncate assertion message contents. Setting value to 0 disables the character limit for truncation.
Controls maximum number of linesto truncate assertion message contents. Setting value to 0 disables the lines limit for truncation.
List of fixtures that will be applied to all test functions; this is semantically the same to apply the @pytest.mark.usefixtures marker to all test functions.
Set a verbosity level specifically for assertion related output, overriding the application wide level.
Set the verbosity level specifically for passed subtests. A value of 1 or higher will show output for passed subtests (failed subtests are always reported). Passed subtests output can be suppressed with the value 0, which overwrites the -v command-line option.
Set a verbosity level specifically for test case execution related output, overriding the application wide level.
DEPRECATED. Alias for strict_xfail. If true, test suite will fail if a test marked with @pytest.mark.xfail unexpectedly passes.
Configuration options for pytest-asyncio. https://pytest-asyncio.readthedocs.io/en/latest/reference/configuration.html
Enables asyncio debug mode for the default event loop used by asynchronous tests and fixtures.
Sets the asyncio mode for pytest-asyncio.
A minimum log level. Can be level name or integer value.
Direct key configuration with proper TOML types (pytest >=9) https://docs.pytest.org/en/stable/reference/reference.html#configuration-options
Add the specified OPTS to the set of command line arguments as if they had been specified by the user.
Sets the directory where the cache plugin’s content is stored.
Settings this to false will make pytest collect classes/functions from test files only if they are defined in that file (as opposed to imported there).
Controls if pytest should attempt to identify namespace packages when collecting Python modules.
Sets console output style during test execution.
pytest by default escapes any non-ascii characters used in unicode strings for the parametrization because it has several downsides. If however you would like to use unicode strings in parametrization and see them in the terminal as is (non-escaped), use this option in your configuration file
Default encoding to use to decode text files with docstrings.
One or more doctest flag names from the standard doctest module.
Allows to pick the action for empty parametersets in parameterization.
Enables the pytest_assertion_pass hook. Make sure to delete any previously generated .pyc cache files.
Exit the pytest process after the per-test timeout is reached by passing exit=True to the faulthandler.dump_traceback_later() function. This is particularly useful to avoid wasting CI resources for test suites that are prone to putting the main Python interpreter into a deadlock state.
Dumps the tracebacks of all threads if a test takes longer than X seconds to run (including fixture setup and teardown). Implemented using the faulthandler.dump_traceback_later() function, so all caveats there apply.
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.
Configures how durations are recorded into the JUnit XML report:
Configures the format of the generated JUnit XML file.
If junit_logging is enabled, configures if the captured output should be written to the JUnit XML file for passing tests.
Configures if captured output should be written to the JUnit XML file.
To set the name of the root test suite xml item, you can configure the junit_suite_name option in your config file.
Allow selective auto-indentation of multiline log messages.
Enable log display during test run (also known as “live logging”).
Sets a time.strftime()-compatible string that will be used when formatting dates for live logging.
Sets a logging-compatible string used to format live logging messages.
A minimum log level. Can be level name or integer value.
Sets a time.strftime()-compatible string that will be used when formatting dates for logging capture.
Sets a file name relative to the current working directory where log messages should be written to, in addition to the other logging facilities that are active.
Sets a time.strftime()-compatible string that will be used when formatting dates for the logging file.
Sets a logging-compatible string used to format logging messages redirected to the logging file.
A minimum log level. Can be level name or integer value.
Sets the mode that the logging file is opened with. The options are 'w' to recreate the file (the default) or 'a' to append to the file.
Sets a logging-compatible string used to format captured logging messages.
A minimum log level. Can be level name or integer value.
When the strict_markers configuration option is set, only known markers - defined in code by core pytest or some plugin - are allowed. You can list additional markers in this setting to add them to the whitelist, in which case you probably want to set strict_markers to true to avoid future regressions.
Specifies a minimal pytest version required for running tests.
Set the directory basename patterns to avoid when recursing for test discovery. The individual (fnmatch-style) patterns are applied to the basename of a directory to decide if to recurse into it.
[
"*.egg",
".*",
"_darcs",
"build",
"CVS",
"dist",
"node_modules",
"venv",
"{arch}"
]
One or more name prefixes or glob-style patterns determining which classes are considered for test collection. Search for multiple glob patterns by adding a space between patterns. By default, pytest will consider any class prefixed with Test as a test collection.
One or more Glob-style file patterns determining which python files are considered as test modules.
[
"test_*.py",
"*_test.py"
]
One or more name prefixes or glob-patterns determining which test functions and methods are considered tests. Search for multiple glob patterns by adding a space between patterns. By default, pytest will consider any function prefixed with test as a test.
[
"test_*"
]
Sets list of directories that should be added to the python search path. Directories will be added to the head of sys.path. Similar to the PYTHONPATH environment variable, the directories will be included in where Python will look for imported modules. Paths are relative to the rootdir directory.
A list of plugins that must be present for pytest to run. Plugins can be listed with or without version specifiers directly following their name.
If set to true, enable 'strict mode', which enables a number of other strict options.
If set to true, any warnings encountered while parsing the pytest section of the configuration file will raise errors.
If set to true, markers not registered in the markers section of the configuration file will raise errors.
If set to true, pytest emits an error if it detects non-unique parameter set IDs. If not set (the default), pytest automatically handles this by adding 0, 1, … to duplicate IDs, making them unique.
If set to true, tests marked with @pytest.mark.xfail that actually succeed will by default fail the test suite.
Sets list of directories that should be searched for tests when no specific directories, files or test ids are given in the command line when executing pytest from the rootdir directory. File system paths may use shell-style wildcards, including the recursive ** pattern. Useful when all project tests are in a known location to speed up test collection and to avoid picking up undesired tests by accident.
How many sessions should we keep the tmp_path directories, according to tmp_path_retention_policy.
Controls which directories created by the tmp_path fixture are kept around, based on test outcome.
Controls maximum number of characters to truncate assertion message contents. Setting value to 0 disables the character limit for truncation.
Controls maximum number of linesto truncate assertion message contents. Setting value to 0 disables the lines limit for truncation.
List of fixtures that will be applied to all test functions; this is semantically the same to apply the @pytest.mark.usefixtures marker to all test functions.
Set a verbosity level specifically for assertion related output, overriding the application wide level.
Set the verbosity level specifically for passed subtests. A value of 1 or higher will show output for passed subtests (failed subtests are always reported). Passed subtests output can be suppressed with the value 0, which overwrites the -v command-line option.
Set a verbosity level specifically for test case execution related output, overriding the application wide level.
DEPRECATED. Alias for strict_xfail. If true, test suite will fail if a test marked with @pytest.mark.xfail unexpectedly passes.
Configuration options for pytest-asyncio. https://pytest-asyncio.readthedocs.io/en/latest/reference/configuration.html
Enables asyncio debug mode for the default event loop used by asynchronous tests and fixtures.
Sets the asyncio mode for pytest-asyncio.