Skip to content

Omit warning prefix in "Bad git executable" message #1816

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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."
  • Loading branch information
EliahKagan committed Feb 6, 2024
commit 3250313d95e37040327c4d8620d03ec4ffc494df
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