Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes the test
test_should_load_plugins_from_property
, which is currently quarantined as a "Heisentest".Current behavior:
The test currently fails because the records that it expects to find in the logger are not present.
Cause:
While the test sets the logger as "DEBUG", it doesn't specify which logger to update. Python loggers are namespaced (typically based on the current file's path), but this has to be defined explicitly. In the absence of a specified logger, any attempts to lookup will return the BaseLogger instance.
The test is therefore updating the log level for the base logger, but when the test runs, the
plugins_manager.py
file defines a namespaced loggerlog = logging.getLogger(__name__)
used throughout the file. Since a different logger is used, the original log level, in this caseINFO
, is used.INFO
is a higher level thanDEBUG
, so the calls tolog.debug()
get filtered out, and when the test looks for log records it finds an empty list.Fix:
Just specify which logger to update when modifying the log level in the test.