Log the start and the end of each test

This commit is contained in:
Pedro Algarvio 2019-01-03 13:39:48 +00:00
parent af778cc509
commit db6e417965
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF

View file

@ -198,8 +198,10 @@ def pytest_configure(config):
)
# Make sure the test suite "knows" this is a pytest test run
RUNTIME_VARS.PYTEST_SESSION = True
# <---- Register Markers ---------------------------------------------------------------------------------------------
# ----- PyTest Tweaks ----------------------------------------------------------------------------------------------->
def set_max_open_files_limits(min_soft=3072, min_hard=4096):
# Get current limits
@ -255,7 +257,23 @@ def set_max_open_files_limits(min_soft=3072, min_hard=4096):
def pytest_report_header():
soft, hard = set_max_open_files_limits()
return 'max open files; soft: {}; hard: {}'.format(soft, hard)
# <---- Register Markers ---------------------------------------------------------------------------------------------
def pytest_runtest_logstart(nodeid):
'''
implements the runtest_setup/call/teardown protocol for
the given test item, including capturing exceptions and calling
reporting hooks.
'''
log.debug('>>>>> START >>>>> %s', nodeid)
def pytest_runtest_logfinish(nodeid):
'''
called after ``pytest_runtest_call``
'''
log.debug('<<<<< END <<<<<<< %s', nodeid)
# <---- PyTest Tweaks ------------------------------------------------------------------------------------------------
# ----- Test Setup -------------------------------------------------------------------------------------------------->