Module: check_mk
Branch: master
Commit: 5192fd5a5892325e5996e75047d6b10b71bad2ed
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5192fd5a589232…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Mar 11 15:39:54 2019 +0100
Another hack to get a working set of modules for tests in the site
This is just a temporary(tm) fix until we clean up the whole site
integration test stuff.
Change-Id: I2fa3a1a8181a690835b76e2830ad2b0b1e2393f0
---
tests/testlib/__init__.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py
index bcff23c..2ceefbe 100644
--- a/tests/testlib/__init__.py
+++ b/tests/testlib/__init__.py
@@ -730,11 +730,14 @@ class Site(object):
bin_dir = venv / "bin"
packages_dir = venv / "lib/python2.7/site-packages"
+ enforce_override = ["backports"]
+
for file_name in os.listdir(str(packages_dir)):
# Only copy modules that do not exist in regular module path
- if os.path.exists("%s/lib/python/%s" % (self.root, file_name)) \
- or os.path.exists("%s/lib/python2.7/site-packages/%s" %
(self.root, file_name)):
- continue
+ if file_name not in enforce_override:
+ if os.path.exists("%s/lib/python/%s" % (self.root, file_name))
\
+ or os.path.exists("%s/lib/python2.7/site-packages/%s" %
(self.root, file_name)):
+ continue
assert os.system("sudo rsync -a --chown %s:%s %s
%s/local/lib/python/" % # nosec
(self.id, self.id, packages_dir / file_name, self.root))
>> 8 == 0