Hey! These docs are for version 2.0, which is no longer officially supported. Click here for the latest version, 2.7!

The pytest Python test framework (https://docs.pytest.org/).

Config section: [pytest]

Basic options

--pytest-args="[<shell_str>, <shell_str>, ...]", ... -- [<shell_str> [<shell_str> [...]]]
PANTS_PYTEST_ARGS
args
default: []
Arguments to pass directly to Pytest, e.g. `--pytest-args="-k test_foo --quiet"`

--[no-]pytest-timeouts
PANTS_PYTEST_TIMEOUTS
timeouts
default: True
Enable test target timeouts. If timeouts are enabled then test targets with a timeout= parameter set on their target will time out after the given number of seconds if not completed. If no timeout is set, then either the default timeout is used or no timeout is configured.

Advanced options

--pytest-version=<str>
PANTS_PYTEST_VERSION
version
default: pytest>=6.0.1,<6.1
Requirement string for Pytest.

--pytest-pytest-plugins="['<str>', '<str>', ...]"
PANTS_PYTEST_PYTEST_PLUGINS
pytest_plugins
default:
[
  "pytest-cov>=2.10.1,<2.11",
  "zipp==2.1.0"
]

Requirement strings for any plugins or additional requirements you'd like to use.

--pytest-timeout-default=<int>
PANTS_PYTEST_TIMEOUT_DEFAULT
timeout_default
default: None
The default timeout (in seconds) for a test target if the `timeout` field is not set on the target.

--pytest-timeout-maximum=<int>
PANTS_PYTEST_TIMEOUT_MAXIMUM
timeout_maximum
default: None
The maximum timeout (in seconds) that may be used on a `python_tests` target.

--pytest-junit-xml-dir=<DIR>
PANTS_PYTEST_JUNIT_XML_DIR
junit_xml_dir
default: None
Specifying a directory causes Junit XML result files to be emitted under that dir for each test run.

--pytest-junit-family=<str>
PANTS_PYTEST_JUNIT_FAMILY
junit_family
default: xunit2
The format of the generated XML file. See https://docs.pytest.org/en/latest/reference.html#confval-junit_family.

--pytest-execution-slot-var=<str>
PANTS_PYTEST_EXECUTION_SLOT_VAR
execution_slot_var
default: None
If a non-empty string, the process execution slot id (an integer) will be exposed to tests under this environment variable name.

Deprecated options

None


Did this page help you?