Skip to content

Commit 07c349c

Browse files
authored
Fix automatic vault login (#21126)
1 parent 67dbd35 commit 07c349c

2 files changed

Lines changed: 12 additions & 13 deletions

File tree

conftest.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
import pytest
44

5-
from robottelo.config import settings
6-
75
pytest_plugins = [
86
# Plugins
97
'pytest_plugins.auto_vault',
@@ -96,14 +94,3 @@ def pytest_runtest_makereport(item, call):
9694
# be "setup", "call", "teardown"
9795

9896
setattr(item, "report_" + report.when, report)
99-
100-
101-
@pytest.hookimpl(hookwrapper=True)
102-
def pytest_runtest_protocol(item, nextitem):
103-
"""Set version source to upstream for tests marked with foremanctl."""
104-
if item.get_closest_marker('foremanctl'):
105-
settings.set('server.version.source', 'upstream')
106-
yield
107-
settings.set('server.version.source', 'internal')
108-
else:
109-
yield

tests/foreman/conftest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import pytest
44

5+
from robottelo.config import settings
56
from robottelo.hosts import Satellite
67
from robottelo.logging import collection_logger
78

@@ -75,3 +76,14 @@ def ui_session_record_property(request, record_property):
7576
):
7677
sat = request.getfixturevalue(fixture)
7778
sat.record_property = record_property
79+
80+
81+
@pytest.hookimpl(hookwrapper=True)
82+
def pytest_runtest_protocol(item, nextitem):
83+
"""Set version source to upstream for tests marked with foremanctl."""
84+
if item.get_closest_marker('foremanctl'):
85+
settings.set('server.version.source', 'upstream')
86+
yield
87+
settings.set('server.version.source', 'internal')
88+
else:
89+
yield

0 commit comments

Comments
 (0)