def pytest_runtest_teardown(item: pytest.Item): '''Hook to run after every test.''' # Inject footer at end of test, may be followed by additional teardown. # Don't do this when running in teamcity, where it's redundant. if not teamcity.is_running_under_teamcity(): print(''' ========== ======= END: {}::{} =========='''.format(sdk_diag.get_test_suite_name(item), item.name))
def pytest_runtest_setup(item: pytest.Item): '''Hook to run before every test.''' # Inject header at start of test, following automatic "path/to/test_file.py::test_name": # Don't do this when running in teamcity, where it's redundant. if not teamcity.is_running_under_teamcity(): print(''' ========== ======= START: {}::{} =========='''.format(sdk_diag.get_test_suite_name(item), item.name)) sdk_diag.handle_test_setup(item) sdk_utils.check_dcos_min_version_mark(item)
def pytest_runtest_setup(item: pytest.Item): '''Hook to run before every test.''' # Inject header at start of test, following automatic "path/to/test_file.py::test_name": # Don't do this when running in teamcity, where it's redundant. if not teamcity.is_running_under_teamcity(): print(''' ========== ======= START: {}::{} =========='''.format(sdk_diag.get_test_suite_name(item), item.name)) if INTEGRATION_TEST_LOG_COLLECTION: sdk_diag.handle_test_setup(item) sdk_utils.check_dcos_min_version_mark(item)
def pytest_runtest_teardown(item: pytest.Item): """Hook to run after every test.""" # Inject footer at end of test, may be followed by additional teardown. # Don't do this when running in teamcity, where it's redundant. if not teamcity.is_running_under_teamcity(): global start_time duration = time.time() - start_time start_time = 0 print( """ ========== ======= END: {}::{} ({}) ==========""".format( sdk_diag.get_test_suite_name(item), item.name, sdk_utils.pretty_duration(duration) ) )
def pytest_runtest_setup(item: pytest.Item): """Hook to run before every test.""" # Inject header at start of test, following automatic "path/to/test_file.py::test_name": # Don't do this when running in teamcity, where it's redundant. if not teamcity.is_running_under_teamcity(): global start_time start_time = time.time() print( """ ========== ======= START: {}::{} ==========""".format( sdk_diag.get_test_suite_name(item), item.name ) ) if INTEGRATION_TEST_LOG_COLLECTION: sdk_diag.handle_test_setup(item) sdk_utils.check_dcos_min_version_mark(item)