From 08ded2927a76a06f51813e8794b48386dd971c94 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 18 Mar 2019 01:27:25 +0100 Subject: [PATCH] capture: do not set logging.raiseExceptions = False Ref: https://github.com/pytest-dev/pytest/issues/4942 --- changelog/4942.trivial.rst | 1 + src/_pytest/capture.py | 7 ------- 2 files changed, 1 insertion(+), 7 deletions(-) create mode 100644 changelog/4942.trivial.rst diff --git a/changelog/4942.trivial.rst b/changelog/4942.trivial.rst new file mode 100644 index 000000000..87dba6b8c --- /dev/null +++ b/changelog/4942.trivial.rst @@ -0,0 +1 @@ +``logging.raiseExceptions`` is not set to ``False`` anymore. diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index 0e8a693e8..95d6e363e 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -56,13 +56,6 @@ def pytest_load_initial_conftests(early_config, parser, args): # make sure that capturemanager is properly reset at final shutdown early_config.add_cleanup(capman.stop_global_capturing) - # make sure logging does not raise exceptions at the end - def silence_logging_at_shutdown(): - if "logging" in sys.modules: - sys.modules["logging"].raiseExceptions = False - - early_config.add_cleanup(silence_logging_at_shutdown) - # finally trigger conftest loading but while capturing (issue93) capman.start_global_capturing() outcome = yield