Skip to content

Commit

Permalink
Remove onedir pytest fixture workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
Megan Wilhite committed Aug 2, 2023
1 parent 4cf6d3c commit 5a3e369
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 40 deletions.
21 changes: 0 additions & 21 deletions tests/pytests/functional/modules/conftest.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
19 changes: 0 additions & 19 deletions tests/pytests/unit/conftest.py
Original file line number Diff line number Diff line change
@@ -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):
"""
Expand Down

0 comments on commit 5a3e369

Please sign in to comment.