From b02d087dbdd6f8b0a4233314356b2442da7fc6c5 Mon Sep 17 00:00:00 2001 From: Gleb Nikonorov Date: Sun, 24 May 2020 20:26:14 -0400 Subject: [PATCH] cleanup code pre pr --- src/_pytest/warnings.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/_pytest/warnings.py b/src/_pytest/warnings.py index 16d8de8f8..4aa2321aa 100644 --- a/src/_pytest/warnings.py +++ b/src/_pytest/warnings.py @@ -111,7 +111,6 @@ def catch_warnings_for_item(config, ihook, when, item): yield for warning_message in log: - # raise ValueError(ihook.pytest_warning_record) ihook.pytest_warning_record.call_historic( kwargs=dict(warning_message=warning_message, nodeid=nodeid, when=when) ) @@ -168,9 +167,8 @@ def pytest_sessionfinish(session): def _issue_warning_captured(warning, hook, stacklevel): """ This function should be used instead of calling ``warnings.warn`` directly when we are in the "configure" stage: - at this point the actual options might not have been set, so we manually trigger the pytest_warning_record hooks - so we can display these warnings in the terminal. - This is a hack until we can sort out #2891. + at this point the actual options might not have been set, so we manually trigger the pytest_warning_record + hook so we can display these warnings in the terminal. This is a hack until we can sort out #2891. :param warning: the warning instance. :param hook: the hook caller