Module: check_mk
Branch: master
Commit: fbbec6e8799093078c65b9260a3397f32b9a670c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fbbec6e8799093…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jun 29 16:54:55 2017 +0200
Fised test directory handling in new pylint checks
Change-Id: I7e3f218c85bf73e06af7400ed9d9bc44d5f512ed
---
tests/pylint/test_pylint_bakery_plugins.py | 8 +++-----
tests/pylint/test_pylint_inventory_plugins.py | 8 +++-----
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/tests/pylint/test_pylint_bakery_plugins.py
b/tests/pylint/test_pylint_bakery_plugins.py
index 799185c..517095e 100755
--- a/tests/pylint/test_pylint_bakery_plugins.py
+++ b/tests/pylint/test_pylint_bakery_plugins.py
@@ -6,10 +6,8 @@ import sys
from testlib import repo_path, cmc_path
import testlib.pylint_cmk as pylint_cmk
-def test_pylint_bakery_plugins():
- base_path = pylint_cmk.get_test_dir()
-
- f = file(base_path + "/cmk-bakery-plugins.py", "w")
+def test_pylint_bakery_plugins(pylint_test_dir):
+ f = file(pylint_test_dir + "/cmk-bakery-plugins.py", "w")
pylint_cmk.add_file(f, os.path.realpath(os.path.join(cmc_path(),
"cmk_base/cee/agent_bakery_plugins.py")))
@@ -19,5 +17,5 @@ def test_pylint_bakery_plugins():
f.close()
- exit_code = pylint_cmk.run_pylint(base_path, cleanup_test_dir=True)
+ exit_code = pylint_cmk.run_pylint(pylint_test_dir)
assert exit_code == 0, "PyLint found an error in agent bakery plugins"
diff --git a/tests/pylint/test_pylint_inventory_plugins.py
b/tests/pylint/test_pylint_inventory_plugins.py
index c993330..ed2b5c7 100755
--- a/tests/pylint/test_pylint_inventory_plugins.py
+++ b/tests/pylint/test_pylint_inventory_plugins.py
@@ -6,10 +6,8 @@ import sys
from testlib import repo_path
import testlib.pylint_cmk as pylint_cmk
-def test_pylint_inventory_plugins():
- base_path = pylint_cmk.get_test_dir()
-
- f = file(base_path + "/cmk-inventory-plugins.py", "w")
+def test_pylint_inventory_plugins(pylint_test_dir):
+ f = file(pylint_test_dir + "/cmk-inventory-plugins.py", "w")
# Fake data structures where checks register (See cmk_base/checks.py)
f.write("""
@@ -55,5 +53,5 @@ def inv_tree(path, default_value=None):
f.close()
- exit_code = pylint_cmk.run_pylint(base_path, cleanup_test_dir=True)
+ exit_code = pylint_cmk.run_pylint(pylint_test_dir)
assert exit_code == 0, "PyLint found an error in inventory plugins"