From 4c18af18e945b7bb11a195c8fc305f829119ab6b Mon Sep 17 00:00:00 2001 From: Wlodek Wencel Date: Wed, 2 Feb 2022 17:41:01 +0100 Subject: [PATCH] added test count in print --- tests/conftest.py | 6 ++++-- tests/forge_cfg.py | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index fd6169d0..e69605b7 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,5 @@ import pytest +from forge_cfg import world def pytest_runtest_setup(item): @@ -13,15 +14,16 @@ def pytest_runtest_teardown(item, nextitem): def pytest_runtest_logstart(nodeid, location): - banner = '\n\n************ START %s ' % nodeid + banner = f'\n\n************ START #{world.test_count} {nodeid} ' banner += '*' * (140 - len(banner)) banner += '\n' banner = '\u001b[36m' + banner + '\u001b[0m' print(banner) + world.test_count += 1 def pytest_runtest_logfinish(nodeid, location): - banner = '\n************ END %s ' % nodeid + banner = f'\n************ END {nodeid} ' banner += '*' * (140 - len(banner)) banner = '\u001b[36;1m' + banner + '\u001b[0m' print(banner) diff --git a/tests/forge_cfg.py b/tests/forge_cfg.py index 127b6e19..d0b7e360 100644 --- a/tests/forge_cfg.py +++ b/tests/forge_cfg.py @@ -248,11 +248,10 @@ class ForgeConfiguration: return self.data_join('kea-leases%s.csv' % proto[1]) - - # global object that stores all needed data: configs, etc. world = threading.local() world.f_cfg = ForgeConfiguration() +world.test_count = 1 def _conv_arg_to_txt(arg): -- GitLab