Add test for added environment variable PRE_COMMIT_CONFIG_PATH

This commit is contained in:
Christian Taedcke 2024-11-29 10:43:55 +01:00
parent 0a39f54c77
commit bc89707d15

View file

@ -1233,3 +1233,14 @@ def test_pre_commit_env_variable_set(cap_out, store, repo_with_passing_hook):
cap_out, store, repo_with_passing_hook, args, environ,
)
assert environ['PRE_COMMIT'] == '1'
def test_pre_commit_config_path_env_variable_set(
cap_out, store, repo_with_passing_hook,
):
args = run_opts()
environ: MutableMapping[str, str] = {}
ret, printed = _do_run(
cap_out, store, repo_with_passing_hook, args, environ,
)
assert environ['PRE_COMMIT_CONFIG_PATH'] == repo_with_passing_hook