Module: check_mk
Branch: master
Commit: bd51e51be8a809d5bf712bcd80ddb9cd26cf125f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bd51e51be8a809…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jan 25 19:52:28 2017 +0100
Filter pylint tests by pytest markers now (more flexible than -k filters)
Change-Id: Ic2cfd6adb8b398f17160a06cfcc1f68584a0f288
---
tests/Makefile | 4 ++--
tests/pylint/test_pylint_checks.py | 5 +++++
tests/pylint/test_pylint_misc.py | 4 ++++
tests/pylint/test_pylint_modules.py | 4 ++++
tests/pylint/test_pylint_web.py | 4 ++++
5 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/tests/Makefile b/tests/Makefile
index 6cdec5f..4ea7e68 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,7 +1,7 @@
SHELL=/bin/bash
help:
- @echo "test - Run all tests"
+ @echo "test - Run integration and git tests"
@echo "test-pylint - Run pylint based tests"
@echo "test-pylint-ci - Run pylint based tests within Jenkins"
@echo "test-bandit - Run bandit (security) tests"
@@ -13,7 +13,7 @@ test:
test-pylint:
- py.test -k pylint
+ py.test -m pylint
test-pylint-ci:
diff --git a/tests/pylint/test_pylint_checks.py b/tests/pylint/test_pylint_checks.py
index 40031f7..4bd3238 100755
--- a/tests/pylint/test_pylint_checks.py
+++ b/tests/pylint/test_pylint_checks.py
@@ -3,9 +3,14 @@
import os
import sys
+import pytest
+
from testlib import repo_path
import testlib.pylint_cmk as pylint_cmk
+# Mark all tests in this file to be pylint checks
+pytestmark = pytest.mark.pylint
+
def test_pylint_checks():
base_path = pylint_cmk.get_test_dir()
diff --git a/tests/pylint/test_pylint_misc.py b/tests/pylint/test_pylint_misc.py
index 642ab72..317e8ef 100755
--- a/tests/pylint/test_pylint_misc.py
+++ b/tests/pylint/test_pylint_misc.py
@@ -3,10 +3,14 @@
import os
import sys
+import pytest
from testlib import repo_path
import testlib.pylint_cmk as pylint_cmk
+# Mark all tests in this file to be pylint checks
+pytestmark = pytest.mark.pylint
+
def test_pylint_misc():
search_paths = [
"cmk_base",
diff --git a/tests/pylint/test_pylint_modules.py b/tests/pylint/test_pylint_modules.py
index ed09a2d..8fd7383 100755
--- a/tests/pylint/test_pylint_modules.py
+++ b/tests/pylint/test_pylint_modules.py
@@ -4,9 +4,13 @@
import os
import sys
import tempfile
+import pytest
import testlib.pylint_cmk as pylint_cmk
+# Mark all tests in this file to be pylint checks
+pytestmark = pytest.mark.pylint
+
def test_pylint_modules():
base_path = pylint_cmk.get_test_dir()
diff --git a/tests/pylint/test_pylint_web.py b/tests/pylint/test_pylint_web.py
index dfb4cab..99cc5e9 100755
--- a/tests/pylint/test_pylint_web.py
+++ b/tests/pylint/test_pylint_web.py
@@ -5,10 +5,14 @@ import os
import sys
import glob
import tempfile
+import pytest
from testlib import cmk_path, cmc_path
import testlib.pylint_cmk as pylint_cmk
+# Mark all tests in this file to be pylint checks
+pytestmark = pytest.mark.pylint
+
def get_web_plugin_dirs():
plugin_dirs = sorted(list(set(os.listdir(cmk_path() + "/web/plugins")
+ os.listdir(cmc_path() + "/web/plugins"))))