tests.test_pytest module¶

Test the Pytest helpers.

tests.test_pytest.test_aligned_colored_fixtures(uncolored, colored)[source]¶
tests.test_pytest.test_isolated_app_dir(invoke, isolated_app_dir)[source]¶

Config discovery is repointed at the isolated directory.

A CLI invoked in-process must not see the host’s real configuration folder, and a configuration file planted in the isolated directory must be picked up by the default --config search pattern.

tests.test_pytest.ambient_color_var(request, monkeypatch)[source]¶

One color variable set in the caller’s shell, before runner starts.

Requested ahead of runner in a signature, so the variable is in place by the time the fixture isolates the environment.

tests.test_pytest.test_runner_ignores_ambient_color_vars(ambient_color_var, runner)[source]¶

A color variable of the caller’s shell does not reach the invoked CLI.

Each one can switch the colors of the output a test matches as plain text.

tests.test_pytest.ambient_cache_home(monkeypatch, tmp_path)[source]¶

A cache folder set in the caller’s shell, before runner starts.

Requested ahead of runner in a signature, so the variable is in place by the time the fixture isolates the environment.

tests.test_pytest.test_runner_isolates_the_cache_dir(ambient_cache_home, runner)[source]¶

The cache directory of a CLI resolves inside the isolated filesystem.

The XDG_CACHE_HOME of the caller’s shell would otherwise send every cache a CLI writes to the folder of the user running the tests.

tests.test_pytest.test_runner_lets_a_test_ask_for_color(runner)[source]¶

A variable passed to one invocation still turns its colors on.