"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/support/pytest/helpers.py" between
salt-3002.1.tar.gz and salt-3002.2.tar.gz

About: SaltStack is a systems management software for data center automation, cloud orchestration, server provisioning, configuration management and more. Community version.

helpers.py  (salt-3002.1):helpers.py  (salt-3002.2)
skipping to change at line 23 skipping to change at line 23
import warnings import warnings
from contextlib import contextmanager from contextlib import contextmanager
import pytest import pytest
import salt.utils.files import salt.utils.files
from tests.support.pytest.loader import LoaderModuleMock from tests.support.pytest.loader import LoaderModuleMock
from tests.support.runtests import RUNTIME_VARS from tests.support.runtests import RUNTIME_VARS
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
if not RUNTIME_VARS.PYTEST_SESSION:
# XXX: Remove this try/except once we fully switch to pytest
class FakePyTestHelpersNamespace:
__slots__ = ()
def register(self, func):
return func
# Patch pytest so it all works under runtests.py
pytest.helpers = FakePyTestHelpersNamespace()
@pytest.helpers.register @pytest.helpers.register
@contextmanager @contextmanager
def temp_directory(name=None): def temp_directory(name=None):
""" """
This helper creates a temporary directory. It should be used as a context ma nager This helper creates a temporary directory. It should be used as a context ma nager
which returns the temporary directory path, and, once out of context, delete s it. which returns the temporary directory path, and, once out of context, delete s it.
Can be directly imported and used, or, it can be used as a pytest helper fun ction if Can be directly imported and used, or, it can be used as a pytest helper fun ction if
``pytest-helpers-namespace`` is installed. ``pytest-helpers-namespace`` is installed.
 End of changes. 1 change blocks. 
0 lines changed or deleted 12 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)