summaryrefslogtreecommitdiff
path: root/run_tests.py
diff options
context:
space:
mode:
authorPicca Frédéric-Emmanuel <picca@synchrotron-soleil.fr>2018-07-31 16:22:25 +0200
committerPicca Frédéric-Emmanuel <picca@synchrotron-soleil.fr>2018-07-31 16:22:25 +0200
commit159ef14fb9e198bb0066ea14e6b980f065de63dd (patch)
treebc37c7d4ba09ee59deb708897fa0571709aec293 /run_tests.py
parent270d5ddc31c26b62379e3caa9044dd75ccc71847 (diff)
New upstream version 0.8.0+dfsg
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)