Skip to content

Commit

Permalink
refactor: rename "subman_global" to "subman_session"
Browse files Browse the repository at this point in the history
"subman_global" is an early naming that was forgotten; since the fixture
is the session-scoped version of the "subman" fixture", then the more
logic name for it is "subman_session".

Signed-off-by: Pino Toscano <[email protected]>
  • Loading branch information
ptoscano committed Jan 16, 2024
1 parent f26af8f commit 331fff5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pytest_client_tools/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ def _subman_common(request):
None,
)
subman = SubscriptionManager()
has_subman_global = (
request.fixturename != "subman_global"
and "subman_global" in request.fixturenames
has_subman_session = (
request.fixturename != "subman_session"
and "subman_session" in request.fixturenames
)
if not has_subman_global:
if not has_subman_session:
# TODO enable debug also for all the categories
subman.config(
logging_default_log_level="DEBUG",
Expand All @@ -163,7 +163,7 @@ def _subman_common(request):
try:
yield subman
finally:
if not has_subman_global:
if not has_subman_session:
with contextlib.suppress(subprocess.SubprocessError):
subman.unregister()
stop_rhsmcertd()
Expand All @@ -176,12 +176,12 @@ def subman(save_subman_files, request):

@pytest.fixture(scope="session")
@_save_and_archive(files=SUBMAN_FILES_TO_SAVE, subdir="subman")
def save_subman_global_files(request):
def save_subman_session_files(request):
yield


@pytest.fixture(scope="session")
def subman_global(save_subman_global_files, request):
def subman_session(save_subman_session_files, request):
yield from _subman_common(request)


Expand Down

0 comments on commit 331fff5

Please sign in to comment.