mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Close the inotify
and watchdog
instances after each test
This commit is contained in:
parent
673e6ecccb
commit
07033471bd
2 changed files with 18 additions and 2 deletions
|
@ -26,6 +26,14 @@ def configure_loader_modules():
|
|||
return {inotify: {}}
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _close_inotify(configure_loader_modules):
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
inotify.close({})
|
||||
|
||||
|
||||
def test_non_list_config():
|
||||
config = {}
|
||||
|
||||
|
@ -212,8 +220,8 @@ def test_multi_files_exclude(tmp_path):
|
|||
dp2 = str(tmp_path / "subdir2")
|
||||
os.mkdir(dp1)
|
||||
os.mkdir(dp2)
|
||||
_exclude1 = "{}/subdir1/*tmpfile*$".format(str(tmp_path))
|
||||
_exclude2 = "{}/subdir2/*filetmp*$".format(str(tmp_path))
|
||||
_exclude1 = f"{str(tmp_path)}/subdir1/*tmpfile*$"
|
||||
_exclude2 = f"{str(tmp_path)}/subdir2/*filetmp*$"
|
||||
config = [
|
||||
{
|
||||
"files": {
|
||||
|
|
|
@ -45,6 +45,14 @@ def configure_loader_modules():
|
|||
return {watchdog: {}}
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _close_watchdog(configure_loader_modules):
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
watchdog.close({})
|
||||
|
||||
|
||||
def assertValid(config):
|
||||
ret = watchdog.validate(config)
|
||||
assert ret == (True, "Valid beacon configuration")
|
||||
|
|
Loading…
Add table
Reference in a new issue