summaryrefslogtreecommitdiff
path: root/run_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'run_tests.py')
-rwxr-xr-xrun_tests.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/run_tests.py b/run_tests.py
index 04b0510..3b9a71a 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -32,7 +32,7 @@ Test coverage dependencies: coverage, lxml.
"""
__authors__ = ["Jérôme Kieffer", "Thomas Vincent"]
-__date__ = "29/01/2018"
+__date__ = "02/03/2018"
__license__ = "MIT"
import distutils.util
@@ -76,7 +76,11 @@ def createBasicHandler():
# Use an handler compatible with unittests, else use_buffer is not working
logging.root.addHandler(createBasicHandler())
+
+# Capture all default warnings
logging.captureWarnings(True)
+import warnings
+warnings.simplefilter('default')
logger = logging.getLogger("run_tests")
logger.setLevel(logging.WARNING)
@@ -292,7 +296,12 @@ def build_project(name, root_dir):
p = subprocess.Popen([sys.executable, "setup.py", "build"],
shell=False, cwd=root_dir)
logger.debug("subprocess ended with rc= %s", p.wait())
- return home
+
+ if os.path.isdir(home):
+ return home
+ alt_home = os.path.join(os.path.dirname(home), "lib")
+ if os.path.isdir(alt_home):
+ return alt_home
def import_project_module(project_name, project_dir):
@@ -311,7 +320,8 @@ def import_project_module(project_name, project_dir):
PROJECT_NAME)
else: # Use built source
build_dir = build_project(project_name, project_dir)
-
+ if build_dir is None:
+ logging.error("Built project is not available !!! investigate")
sys.path.insert(0, build_dir)
logger.warning("Patched sys.path, added: '%s'", build_dir)
module = importer(project_name)