From 7003e2a03e139366ba75993acf75912bef2d7697 Mon Sep 17 00:00:00 2001 From: Antti Kaihola <13725+akaihola@users.noreply.github.com> Date: Mon, 29 Jul 2024 21:46:26 +0300 Subject: [PATCH] Adjust `--stdin-filename` tests to new exit codes --- src/darker/tests/test_main_stdin_filename.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/darker/tests/test_main_stdin_filename.py b/src/darker/tests/test_main_stdin_filename.py index 6f1080f57..5b1b3bf47 100644 --- a/src/darker/tests/test_main_stdin_filename.py +++ b/src/darker/tests/test_main_stdin_filename.py @@ -10,6 +10,7 @@ import toml import darker.__main__ +from darkgraylib.command_line import EXIT_CODE_CMDLINE_ERROR from darkgraylib.config import ConfigurationError from darkgraylib.testtools.git_repo_plugin import GitRepoFixture from darkgraylib.testtools.helpers import raises_if_exception @@ -18,7 +19,7 @@ @pytest.mark.kwparametrize( - dict(expect=SystemExit(2)), + dict(expect=SystemExit(EXIT_CODE_CMDLINE_ERROR)), dict(config_src=["a.py"], expect_a_py='modified = "a.py worktree"\n'), dict(config_src=["b.py"], src=["a.py"], expect_a_py='modified = "a.py worktree"\n'), dict( @@ -125,8 +126,8 @@ " ':WORKTREE:'" ), ), - dict(revision="..:STDIN:", expect=SystemExit(2)), - dict(revision="..:WORKTREE:", expect=SystemExit(2)), + dict(revision="..:STDIN:", expect=SystemExit(EXIT_CODE_CMDLINE_ERROR)), + dict(revision="..:WORKTREE:", expect=SystemExit(EXIT_CODE_CMDLINE_ERROR)), config_src=None, src=[], stdin_filename=None,