tests.test_testing moduleΒΆ

Test the testing utilities and the simulation of CLI execution.

tests.test_testing.test_real_fs()[source]ΒΆ

Check a simple test is not caught into the CLI runner fixture which is encapsulating all filesystem access into temporary directory structure.

tests.test_testing.test_temporary_fs(runner)[source]ΒΆ

Check the CLI runner fixture properly encapsulated the filesystem in temporary directory.

tests.test_testing.test_runner_output()[source]ΒΆ
tests.test_testing.check_default_colored_rendering(result)[source]ΒΆ
tests.test_testing.check_default_uncolored_rendering(result)[source]ΒΆ
tests.test_testing.check_forced_uncolored_rendering(result)[source]ΒΆ
tests.test_testing.test_invoke_optional_color(invoke)[source]ΒΆ
tests.test_testing.test_invoke_default_color(invoke)[source]ΒΆ
tests.test_testing.test_invoke_forced_color_stripping(invoke)[source]ΒΆ
tests.test_testing.test_invoke_color_keep(invoke)[source]ΒΆ
tests.test_testing.test_invoke_force_color(invoke)[source]ΒΆ

Test colors are preserved while invoking, and forced to be rendered on Windows.

tests.test_testing.test_invoke_force_color_contradicting_color_raises()[source]ΒΆ

Asking for forced colors and stripped ones at once is refused.

tests.test_testing.test_invoke_catch_exceptions_follows_the_runner(runner_catches, invoke_catches, propagates)[source]ΒΆ

invoke() falls back to the runner’s own catch_exceptions setting.

tests.test_testing.test_command_default_color()[source]ΒΆ

With @command and no color env var, Context and ColorOption resolve the GNU auto default (ctx.color=None), yet a forced runner still renders ANSI codes.

tests.test_testing.test_command_no_color_flag()[source]ΒΆ

Invoke with –no-color. Verify ctx.color=False and ANSI stripped from echo output.

tests.test_testing.test_force_color_attribute()[source]ΒΆ

CliRunner.force_color=True applies force_color to every run.

tests.test_testing.test_no_color_envvar()[source]ΒΆ

NO_COLOR=1 env var causes ctx.color=False via ColorOption.

tests.test_testing.test_force_color_envvar()[source]ΒΆ

FORCE_COLOR=1 env var keeps ctx.color=True via ColorOption.

tests.test_testing.test_should_strip_ansi_non_tty()[source]ΒΆ

In a test runner (non-TTY), should_strip_ansi behaves based on color arg.

tests.test_testing.test_resolve_color_default_no_context()[source]ΒΆ

Outside any Click context, resolve_color_default returns None or passed value.