-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
caplog fixture doesn't restore log level after test #7569
Copy link
Copy link
Closed
Labels
plugin: loggingrelated to the logging builtin pluginrelated to the logging builtin plugintype: bugproblem that needs to be addressedproblem that needs to be addressedtype: regressionindicates a problem that was introduced in a release which was working previouslyindicates a problem that was introduced in a release which was working previously
Metadata
Metadata
Assignees
Labels
plugin: loggingrelated to the logging builtin pluginrelated to the logging builtin plugintype: bugproblem that needs to be addressedproblem that needs to be addressedtype: regressionindicates a problem that was introduced in a release which was working previouslyindicates a problem that was introduced in a release which was working previously
From the documentation at https://docs.pytest.org/en/6.0.0/logging.html#caplog-fixture, "The log levels set are restored automatically at the end of the test".
It used to work, but looks broken in new 6.0 release. Minimal example to reproduce:
It prints "0" for pytest<6, "42" after.