Skip to content

Commit 15ea5ce

Browse files
authored
Merge pull request #4943 from blueyed/remove-silence_logging_at_shutdown
capture: do not set logging.raiseExceptions = False
2 parents 32a8d50 + 08ded29 commit 15ea5ce

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

changelog/4942.trivial.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
``logging.raiseExceptions`` is not set to ``False`` anymore.

src/_pytest/capture.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,6 @@ def pytest_load_initial_conftests(early_config, parser, args):
5656
# make sure that capturemanager is properly reset at final shutdown
5757
early_config.add_cleanup(capman.stop_global_capturing)
5858

59-
# make sure logging does not raise exceptions at the end
60-
def silence_logging_at_shutdown():
61-
if "logging" in sys.modules:
62-
sys.modules["logging"].raiseExceptions = False
63-
64-
early_config.add_cleanup(silence_logging_at_shutdown)
65-
6659
# finally trigger conftest loading but while capturing (issue93)
6760
capman.start_global_capturing()
6861
outcome = yield

0 commit comments

Comments
 (0)