From 2c4f79425ae0e7064b3332297a678ee9d9cc89c1 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 24 Sep 2024 09:39:41 +0200 Subject: [PATCH] Add license_context fixture with scope=sesson and autouse=True with increment "preppost" Signed-off-by: paul.profizi --- tests/conftest.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 458a5db423..e17a9e77cf 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -619,3 +619,12 @@ def count_servers(): # assert num_dpf_exe == 1 request.addfinalizer(count_servers) + + +@pytest.fixture(scope="session", autouse=True) +def license_context(): + if SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_6_2: + with core.LicenseContextManager(increment_name="preppost", license_timeout_in_seconds=1.0): + yield + else: + yield