Skip to content

Commit

Permalink
Test that extra prefix "WARNING:" is omitted
Browse files Browse the repository at this point in the history
This changes test_initial_refresh_from_bad_git_path_env_warn to
assert a message with no added "WARNING:" prefix. As discussed
in gitpython-developers#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."
  • Loading branch information
EliahKagan committed Feb 6, 2024
1 parent db36174 commit 3250313
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",))
Expand Down

0 comments on commit 3250313

Please sign in to comment.