Pants v2: The ergonomic build system

Welcome to the Pants v2 documentation hub!

Pants v2 is a fast, scalable, user-friendly 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

debug

--[no-]test-debug
PANTS_TEST_DEBUG
default: False

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


force

--[no-]test-force
PANTS_TEST_FORCE
default: False

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


output

--test-output=<ShowOutput>
PANTS_TEST_OUTPUT
one of: all, failed, none
default: failed

Show stdout/stderr for these tests.


use_coverage

--[no-]test-use-coverage
PANTS_TEST_USE_COVERAGE
default: False

Generate a coverage report if the test runner supports it.


open_coverage

--[no-]test-open-coverage
PANTS_TEST_OPEN_COVERAGE
default: False

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


extra_env_vars

--test-extra-env-vars="['<str>', '<str>', ...]"
PANTS_TEST_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.


Advanced options

None

Deprecated options

None

Related subsystems

coverage-py, download-pex-bin, grpc_python_plugin, lambdex, pex, pex-binary-defaults, protoc, pytest, python-infer, python-native-code, python-protobuf, python-protobuf.mypy-plugin, python-repos, python-setup, setup-py-generation, setuptools, 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.