Module: check_mk
Branch: master
Commit: abc519958aaab19fe55a13b9bf791d199514f911
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=abc519958aaab1…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Mar 27 13:04:35 2018 +0200
Fixed pytest not finding conftest.py during integration tests
Change-Id: I2691da32b38688a6a3c0e7440e73a950e79c3abe
---
tests/testlib/__init__.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py
index 459033d..28077e6 100644
--- a/tests/testlib/__init__.py
+++ b/tests/testlib/__init__.py
@@ -768,7 +768,13 @@ class Site(object):
env_var_str = " ".join([ "%s=%s" % (k, pipes.quote(v))
for k, v in env_vars.items() ]) + " "
- cmd = env_var_str + subprocess.list2cmdline(["python",
self.path("local/bin/py.test")] + sys.argv[1:] + [ cmk_path() +
"/tests" ])
+ cmd_parts = [
+ "python", self.path("local/bin/py.test"),
+ ] + sys.argv[1:]
+
+ cmd = "cd %s && " % pipes.quote(cmk_path())
+ cmd += env_var_str + subprocess.list2cmdline(cmd_parts)
+ print cmd
args = [ "/usr/bin/sudo", "--", "/bin/su",
"-l", self.id, "-c", cmd ]
return subprocess.call(args)