From 3a42b0ce589c28540d10c68404c362722a9571a3 Mon Sep 17 00:00:00 2001 From: Megan Wilhite Date: Wed, 2 Aug 2023 11:45:02 -0600 Subject: [PATCH] Remove onedir pytest fixture workaround --- tests/pytests/functional/modules/conftest.py | 21 -------------------- tests/pytests/unit/conftest.py | 19 ------------------ 2 files changed, 40 deletions(-) diff --git a/tests/pytests/functional/modules/conftest.py b/tests/pytests/functional/modules/conftest.py index 49d3c71da9d..19cd807cae9 100644 --- a/tests/pytests/functional/modules/conftest.py +++ b/tests/pytests/functional/modules/conftest.py @@ -1,27 +1,6 @@ -import os - import pytest -@pytest.fixture(scope="package", autouse=True) -def _onedir_env(): - """ - Functional tests cannot currently test the - onedir artifact. This will need to be removed - when we do add onedir support for functional tests. - This is specifically needed for testing the new - package grain when calling from the grains module. - """ - if os.environ.get("ONEDIR_TESTRUN", "0") == "1": - try: - os.environ["ONEDIR_TESTRUN"] = "0" - yield - finally: - os.environ["ONEDIR_TESTRUN"] = "1" - else: - yield - - @pytest.fixture(scope="module") def modules(loaders): return loaders.modules diff --git a/tests/pytests/unit/conftest.py b/tests/pytests/unit/conftest.py index 9c883571c42..43deeaa618e 100644 --- a/tests/pytests/unit/conftest.py +++ b/tests/pytests/unit/conftest.py @@ -1,27 +1,8 @@ -import os - import pytest import salt.config -@pytest.fixture(scope="package", autouse=True) -def _onedir_env(): - """ - Unit tests cannot currently test the - onedir artifact. This will need to be removed - when we do add onedir support for functional tests. - """ - if os.environ.get("ONEDIR_TESTRUN", "0") == "1": - try: - os.environ["ONEDIR_TESTRUN"] = "0" - yield - finally: - os.environ["ONEDIR_TESTRUN"] = "1" - else: - yield - - @pytest.fixture def minion_opts(tmp_path): """