Pants v2: Fast, consistent builds for Python and more

Welcome to the Pants v2 documentation hub!

Pants v2 is a fast, scalable build system for growing codebases. It's currently focused on Python, with support for other languages coming soon.

Here you'll find guides to help you get started with Pants v2, comprehensive documentation on how to configure, run and customize Pants v2, and information on how to get help from the Pants community.

Get Started
./pants test [args]

Run tests.

Config section: [test]

Basic options

--[no-]test-debug
PANTS_TEST_DEBUG
debug
default: False
Run a single test target in an interactive process. This is necessary, for example, when you add breakpoints to your code.

--[no-]test-force
PANTS_TEST_FORCE
force
default: False
Force the tests to run, even if they could be satisfied from cache.

--test-output=<ShowOutput>
PANTS_TEST_OUTPUT
output
one of: all, failed, none
default: failed
Show stdout/stderr for these tests.

--[no-]test-use-coverage
PANTS_TEST_USE_COVERAGE
use_coverage
default: False
Generate a coverage report if the test runner supports it.

--[no-]test-open-coverage
PANTS_TEST_OPEN_COVERAGE
open_coverage
default: False
If a coverage report file is generated, open it on the local system if the system supports this.

--test-extra-env-vars="['<str>', '<str>', ...]"
PANTS_TEST_EXTRA_ENV_VARS
extra_env_vars
default: []
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. `value` may be a string with spaces in it such as `ENV_VAR=has some spaces`. `ENV_VAR=` sets a variable to be the empty string.

Advanced options

None

Deprecated options

None

Related subsystems

coverage-py, download-pex-bin, lambdex, pex, protoc, pytest, python-binary, python-infer, python-native-code, python-repos, python-setup, source, subprocess-environment, test

Updated about a month ago


test


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.