Module: check_mk
Branch: master
Commit: fc799ecf72adf1dd338cf8f8d1c8bf6a536a5af3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fc799ecf72adf1…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 24 11:58:24 2018 +0200
Moved pylint_test_dir fixture to test_pylint file
Change-Id: Ifab3f173962ff1c1f14760381f3e4b1bba04326c
---
tests/pylint/conftest.py | 26 --------------------------
tests/pylint/test_pylint.py | 26 ++++++++++++++++++++++++++
2 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/tests/pylint/conftest.py b/tests/pylint/conftest.py
index 30a8be0..09f783b 100644
--- a/tests/pylint/conftest.py
+++ b/tests/pylint/conftest.py
@@ -1,9 +1,5 @@
#!/usr/bin/env python
-import sys
-import os
-import tempfile
-import shutil
import pytest
# pylint tests should not be executed in site.
@@ -11,25 +7,3 @@ import pytest
@pytest.fixture(scope="session")
def site(request):
pass
-
-(a)pytest.fixture(scope="function")
-def pylint_test_dir():
- base_path = os.environ.get("WORKDIR")
- if base_path:
- base_path += "/" + os.path.basename(sys.argv[0])
- if not os.path.exists(base_path):
- os.makedirs(base_path)
- else:
- base_path = None
-
- test_dir = tempfile.mkdtemp(prefix="cmk_pylint", dir=base_path)
-
- print("Prepare check in %s ..." % test_dir)
- yield test_dir
-
- #
- # Cleanup code
- #
-
- print("Cleanup pylint test dir %s ..." % test_dir)
- shutil.rmtree(test_dir)
diff --git a/tests/pylint/test_pylint.py b/tests/pylint/test_pylint.py
index f5f5c93..859cbad 100755
--- a/tests/pylint/test_pylint.py
+++ b/tests/pylint/test_pylint.py
@@ -3,10 +3,36 @@
import os
import sys
+import pytest
+import tempfile
+import shutil
from testlib import cmk_path, cmc_path, cme_path, repo_path
import testlib.pylint_cmk as pylint_cmk
+(a)pytest.fixture(scope="function")
+def pylint_test_dir():
+ base_path = os.environ.get("WORKDIR")
+ if base_path:
+ base_path += "/" + os.path.basename(sys.argv[0])
+ if not os.path.exists(base_path):
+ os.makedirs(base_path)
+ else:
+ base_path = None
+
+ test_dir = tempfile.mkdtemp(prefix="cmk_pylint", dir=base_path)
+
+ print("Prepare check in %s ..." % test_dir)
+ yield test_dir
+
+ #
+ # Cleanup code
+ #
+
+ print("Cleanup pylint test dir %s ..." % test_dir)
+ shutil.rmtree(test_dir)
+
+
def test_pylint_misc():
# Only specify the path to python packages or modules here
modules_or_packages = [