Python Test Acceleration Configuration

Python Test Acceleration works out of the box, but can be configured to take advantage of your specific environment.

Have configuration needs not addressed here? Give us a holler at hi@yourbase.io.

Common Settings


When set, YourBase will consider the terms of service permanently accepted for your organization, and will not output terms of service agreement prompts or info messages.


When set alongside YOURBASE_COHORT_COUNT, tells YourBase the cohort ID to run. Used for sharded or otherwise parallelized test suites.

See YOURBASE_COHORT_COUNT for more information.


When set alongside YOURBASE_ACTIVE_COHORT, tells YourBase how many cohorts tests should be split into. Used for sharded or otherwise parallelized test suites.

This pair of settings lets YourBase work with your existing sharding or parallelization setup. You likely already have a test splitting solution in place whose job is to slice up your pool of tests so that each shard or process runs their fair share of tests.

However, most test splitting solutions are not sticky; tests “jump” shards as the pool changes. The effectiveness of YourBase acceleration scales with test stickiness, so these solutions are not recommended for use with YourBase.

As a convenience, YourBase provides a built-in sticky test splitting implementation. To use it, first remove your existing test splitting tools. It should appear as if each shard will run the entire test suite.

Then, set YOURBASE_ACTIVE_COHORT to the ID of the current shard or process (starting from 1), and set YOURBASE_COHORT_COUNT to the total number of shards or processes. Under the hood, YourBase will just-in-time deselect tests that aren’t in the current cohort. This selection is consistent between runs; given the same cohort ID and count, tests will be selected to the same shard for life.


When set to a valid license key, YourBase acceleration will be unlocked for use after the end of the free trial. Email hi@yourbase.io to obtain a license key.


When on, YourBase will not skip tests. Instead, it will record the duration and outcome of each test it believes can be skipped.

If any of these tests fail, this is a bug in YourBase’s tracing or acceleration. YourBase will complain loudly and output details; please report these to bugs@yourbase.io.

Otherwise, the total amount of time that could have been saved is output to stdout.


When set, YourBase will synchronize dependency graphs with the given remote location. This setting is recommended for use when using YourBase in CI, as the filesystem will not be a dependable store for dependency graphs.

Dependency graphs generated from dirty working trees will not be synchronized, as they can poison the cache. See YOURBASE_SYNC_DIRTY to override this behavior.

Currently, the only supported protocol is s3.


System credentials for AWS will be used if present. To use different credentials than the system credentials, see YOURBASE_AWS_ACCESS_KEY_ID and YOURBASE_AWS_SECRET_ACCESS_KEY.

# Without a key prefix
export YOURBASE_REMOTE_CACHE=s3://my-bucket-name

# With a key prefix
export YOURBASE_REMOTE_CACHE=s3://my-bucket-name/my/key/prefix

Uncommon settings


When set alongside YOURBASE_AWS_SECRET_ACCESS_KEY, forces YourBase to use these credentials over system credentials when interacting with AWS.

These environment variables are recommended for use if your system credentials are fudged for the sake of your tests.


When set alongside YOURBASE_AWS_ACCESS_KEY_ID, forces YourBase to use these credentials over system credentials when interacting with AWS.

These environment variables are recommended for use if your system credentials are fudged for the sake of your tests.


When on, YourBase will report significantly more internal information to stdout, stderr, and the file returned by this expression:

echo ${XDG_STATE_HOME-~/.local/state}/yourbase/python.log


When on, YourBase will not load.

Enabling this setting then manually attaching to a test framework using yourbase.attach produces undefined behavior.


When on, YourBase will not look in the filesystem for a dependency graph. If YOURBASE_REMOTE_CACHE is set, it will still be used as normal.

This setting can be used if the local cache is expected to be poisoned. This can happen if cohorting is used against a local cache.


When on, YourBase will synchronize graphs even if the Git working tree is dirty.

This setting is not recommended for use if you plan to use YourBase on developer machines, as it will poison the remote cache.

If you only plan to use YourBase in CI, this setting can help you overcome situations where you need your working tree to be dirty while building, and you know the dirtiness will not affect the dependency graph.

If that situation does not apply to you, do not enable this setting.


When on, YourBase will send anonymized telemetry data to api.yourbase.io over HTTPS for the purposes of improving the product.

Telemetry data never includes your code.


When on, YourBase will use a slower tracing algorithm that is less prone to conflicts with other packages than the default. Only enable this if you experience issues with the default algorithm.


The directory YourBase should treat as the project directory. Only code in this directory, or one of its descendants, is guaranteed to be traced. You usually do not need to change this.