diff --git a/tests/foreman/virtwho/conftest.py b/tests/foreman/virtwho/conftest.py index 9b09a66c0fa..a83875fe130 100644 --- a/tests/foreman/virtwho/conftest.py +++ b/tests/foreman/virtwho/conftest.py @@ -49,7 +49,10 @@ def test_foo(session): # your ui test steps here session.architecture.create({'name': 'bar'}) """ - return module_target_sat.ui_session(test_name, module_user.login, module_user.password) + with module_target_sat.ui_session( + test_name, module_user.login, module_user.password + ) as session: + return session @pytest.fixture(scope='module') @@ -96,4 +99,7 @@ def test_foo(session): # your ui test steps here session.architecture.create({'name': 'bar'}) """ - return module_target_sat.ui_session(test_name, module_user_sca.login, module_user_sca.password) + with module_target_sat.ui_session( + test_name, module_user_sca.login, module_user_sca.password + ) as session_sca: + return session_sca