You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change warning refresh-mode tests to expect logging
This is instead of the current behavior writing the message to
stdout.
This commit does not change the behavior of the code under test,
but it changes tests to assert the following:
- "Bad git executable" messages are logged, at level CRITICAL.
- "log" (and "l") is recognized as another synonym of "warn".
- "silent" is recognized as a synonym of "quiet" (as "silence" is).
Although it is ambiguous whether this should be logged at level
ERROR or CRITICAL, because git.refresh is still expected to be
usable and can be called manually, not having a working git is a
condition in which GitPython, and any program that really relies on
its functionality, should be expected not work. That is the general
rationale for using CRIICAL here. There are also two specific
reasons:
- Existing messages GitPython logs as ERROR typically represent
errors in individual operations on repositories, which could fail
without indicating that GitPython's overall functionality is in
an unusable state. Using the higher CRITICAL level for this
situation makes sense for contrast.
- Prior to #1813, logging messsges emitted from GitPython modules,
no matter the level, were suppressed when logging was not
configured, but because this message was printed instead of
being logged, it was still shown. Now that it is to be logged,
there may be a benefit to have an easy way for someone to bring
back a close approximation of the old behavior. Having this
message be at a higher logging level makes that easier to do.
(This is a less important reason, as that should rarely be done.)
test_initial_refresh_from_bad_git_path_env_warn is the main changed
test. All tests should pass again once code is changed for #1808.
0 commit comments