From 3250313d95e37040327c4d8620d03ec4ffc494df Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Tue, 6 Feb 2024 01:57:53 -0500 Subject: [PATCH] Test that extra prefix "WARNING:" is omitted This changes test_initial_refresh_from_bad_git_path_env_warn to assert a message with no added "WARNING:" prefix. As discussed in #1815, the extra prefix is confusing with logging configured, showing "CRITICAL:git.cmd:WARNING: Bad git executable." instead of "CRITICAL:git.cmd: Bad git executable." --- test/test_git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_git.py b/test/test_git.py index b02a92b0f..f12428f9e 100644 --- a/test/test_git.py +++ b/test/test_git.py @@ -363,7 +363,7 @@ def test_initial_refresh_from_bad_git_path_env_warn(self, case): refresh() self.assertEqual(len(ctx.records), 1) message = ctx.records[0].getMessage() - self.assertRegex(message, r"\AWARNING: Bad git executable.\n") + self.assertRegex(message, r"\ABad git executable.\n") self.assertEqual(self.git.GIT_PYTHON_GIT_EXECUTABLE, "git") @ddt.data(("2",), ("r",), ("raise",), ("e",), ("error",))