cleanup code pre pr

This commit is contained in:
Gleb Nikonorov 2020-05-24 20:26:14 -04:00
parent 9ee6550181
commit b02d087dbd
1 changed files with 2 additions and 4 deletions

View File

@ -111,7 +111,6 @@ def catch_warnings_for_item(config, ihook, when, item):
yield yield
for warning_message in log: for warning_message in log:
# raise ValueError(ihook.pytest_warning_record)
ihook.pytest_warning_record.call_historic( ihook.pytest_warning_record.call_historic(
kwargs=dict(warning_message=warning_message, nodeid=nodeid, when=when) 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): 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: 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 at this point the actual options might not have been set, so we manually trigger the pytest_warning_record
so we can display these warnings in the terminal. hook so we can display these warnings in the terminal. This is a hack until we can sort out #2891.
This is a hack until we can sort out #2891.
:param warning: the warning instance. :param warning: the warning instance.
:param hook: the hook caller :param hook: the hook caller