Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import pytest

from robottelo.config import settings

pytest_plugins = [
# Plugins
'pytest_plugins.auto_vault',
Expand Down Expand Up @@ -96,14 +94,3 @@ def pytest_runtest_makereport(item, call):
# be "setup", "call", "teardown"

setattr(item, "report_" + report.when, report)


@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_protocol(item, nextitem):
"""Set version source to upstream for tests marked with foremanctl."""
if item.get_closest_marker('foremanctl'):
settings.set('server.version.source', 'upstream')
yield
settings.set('server.version.source', 'internal')
else:
yield
12 changes: 12 additions & 0 deletions tests/foreman/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pytest

from robottelo.config import settings
from robottelo.hosts import Satellite
from robottelo.logging import collection_logger

Expand Down Expand Up @@ -75,3 +76,14 @@ def ui_session_record_property(request, record_property):
):
sat = request.getfixturevalue(fixture)
sat.record_property = record_property


@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_protocol(item, nextitem):
"""Set version source to upstream for tests marked with foremanctl."""
if item.get_closest_marker('foremanctl'):
settings.set('server.version.source', 'upstream')
yield
settings.set('server.version.source', 'internal')
else:
yield
Loading