HomeDocs
DocsCommunityTestimonialsUsersGitHubTwitterBlogJobsTermsPrivacyCookies
TermsPrivacyCookies
Hey! These docs are for version 2.10, which is no longer officially supported. Click here for the latest version, 2.15!




Run tests.

Backend: <span style="color: purple"><code>pants.core</code></span> Config section: <span style="color: purple"><code>[test]</code></span>

## Basic options

<div style="color: purple"> <h3><code>debug</code></h3> <code>--[no-]test-debug</code><br> <code>PANTS_TEST_DEBUG</code><br> </div> <div style="padding-left: 2em;"> <span style="color: green">default: <code>False</code></span>

<br>

Run tests sequentially in an interactive process. This is necessary, for example, when you add breakpoints to your code.

</div> <br>

<div style="color: purple"> <h3><code>force</code></h3> <code>--[no-]test-force</code><br> <code>PANTS_TEST_FORCE</code><br> </div> <div style="padding-left: 2em;"> <span style="color: green">default: <code>False</code></span>

<br>

Force the tests to run, even if they could be satisfied from cache.

</div> <br>

<div style="color: purple"> <h3><code>output</code></h3> <code>--test-output=&lt;ShowOutput&gt;</code><br> <code>PANTS_TEST_OUTPUT</code><br> </div> <div style="padding-left: 2em;"> <span style="color: green">one of: <code>all, failed, none</code></span><br> <span style="color: green">default: <code>failed</code></span>

<br>

Show stdout/stderr for these tests.

</div> <br>

<div style="color: purple"> <h3><code>use_coverage</code></h3> <code>--[no-]test-use-coverage</code><br> <code>PANTS_TEST_USE_COVERAGE</code><br> </div> <div style="padding-left: 2em;"> <span style="color: green">default: <code>False</code></span>

<br>

Generate a coverage report if the test runner supports it.

</div> <br>

<div style="color: purple"> <h3><code>open_coverage</code></h3> <code>--[no-]test-open-coverage</code><br> <code>PANTS_TEST_OPEN_COVERAGE</code><br> </div> <div style="padding-left: 2em;"> <span style="color: green">default: <code>False</code></span>

<br>

If a coverage report file is generated, open it on the local system if the system supports this.

</div> <br>

<div style="color: purple"> <h3><code>extra_env_vars</code></h3> <code>--test-extra-env-vars=&quot;['&lt;str&gt;', '&lt;str&gt;', ...]&quot;</code><br> <code>PANTS_TEST_EXTRA_ENV_VARS</code><br> </div> <div style="padding-left: 2em;"> <span style="color: green">default: <code>[]</code></span>

<br>

Additional environment variables to include in test processes. Entries are strings in the form `ENV_VAR=value` to use explicitly; or just `ENV_VAR` to copy the value of a variable in Pants's own environment.

</div> <br>

## Advanced options

<div style="color: purple"> <h3><code>xml_dir</code></h3> <code>--test-xml-dir=&lt;DIR&gt;</code><br> <code>PANTS_TEST_XML_DIR</code><br> </div> <div style="padding-left: 2em;"> <span style="color: green">default: <code>None</code></span>

<br>

Specifying a directory causes Junit XML result files to be emitted under that dir for each test run that supports producing them.

</div> <br>

## Deprecated options

None