mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Run onedir pytest fixture only on module tests
This commit is contained in:
parent
dc07caab95
commit
2de8317e70
2 changed files with 19 additions and 16 deletions
|
@ -1,5 +1,4 @@
|
|||
import logging
|
||||
import os
|
||||
import shutil
|
||||
|
||||
import pytest
|
||||
|
@ -8,21 +7,6 @@ from saltfactories.utils.functional import Loaders
|
|||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@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.
|
||||
"""
|
||||
if os.environ.get("ONEDIR_TESTRUN", "0") == "1":
|
||||
try:
|
||||
os.environ["ONEDIR_TESTRUN"] = "0"
|
||||
yield
|
||||
finally:
|
||||
os.environ["ONEDIR_TESTRUN"] = "1"
|
||||
|
||||
|
||||
@pytest.fixture(scope="package")
|
||||
def minion_id():
|
||||
return "func-tests-minion-opts"
|
||||
|
|
|
@ -1,6 +1,25 @@
|
|||
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"
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def modules(loaders):
|
||||
return loaders.modules
|
||||
|
|
Loading…
Add table
Reference in a new issue