Module: check_mk
Branch: master
Commit: e9708946d3a5b2ee3c02bda8732bafd93f5fa841
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e9708946d3a5b2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri May 25 18:02:40 2018 +0200
Automatically clear config caches in config tests
Change-Id: Icf3c807b1e00f101a8d8c2d9d5b617e6c50fd826
---
tests/unit/cmk_base/test_config.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tests/unit/cmk_base/test_config.py b/tests/unit/cmk_base/test_config.py
index 36f106d..db056c7 100644
--- a/tests/unit/cmk_base/test_config.py
+++ b/tests/unit/cmk_base/test_config.py
@@ -3,6 +3,13 @@ import pytest
import cmk_base.config as config
import cmk_base.rulesets as rulesets
+(a)pytest.fixture(autouse=True, scope="function")
+def clear_config_caches(monkeypatch):
+ import cmk_base
+ import cmk_base.caching
+ monkeypatch.setattr(cmk_base, "config_cache",
cmk_base.caching.CacheManager())
+ monkeypatch.setattr(cmk_base, "runtime_cache",
cmk_base.caching.CacheManager())
+
@pytest.mark.parametrize("hostname,tags,result", [
("testhost", [], True),
("testhost", ["ip-v4"], True),