diff options
author | Picca Frédéric-Emmanuel <picca@synchrotron-soleil.fr> | 2019-05-28 08:16:16 +0200 |
---|---|---|
committer | Picca Frédéric-Emmanuel <picca@synchrotron-soleil.fr> | 2019-05-28 08:16:16 +0200 |
commit | a763e5d1b3921b3194f3d4e94ab9de3fbe08bbdd (patch) | |
tree | 45d462ed36a5522e9f3b9fde6c4ec4918c2ae8e3 /silx/test | |
parent | cebdc9244c019224846cb8d2668080fe386a6adc (diff) |
New upstream version 0.10.1+dfsg
Diffstat (limited to 'silx/test')
-rw-r--r-- | silx/test/__init__.py | 3 | ||||
-rw-r--r-- | silx/test/test_resources.py | 7 | ||||
-rw-r--r-- | silx/test/utils.py | 22 |
3 files changed, 19 insertions, 13 deletions
diff --git a/silx/test/__init__.py b/silx/test/__init__.py index 5ac3524..8bada7f 100644 --- a/silx/test/__init__.py +++ b/silx/test/__init__.py @@ -31,7 +31,7 @@ It will skip all tests from :mod:`silx.test.gui`. __authors__ = ["T. Vincent"] __license__ = "MIT" -__date__ = "09/11/2017" +__date__ = "21/12/2018" import logging @@ -91,6 +91,7 @@ def suite(): def run_tests(): """Run test complete test_suite""" + test_options.configure() runner = unittest.TextTestRunner() if not runner.run(suite()).wasSuccessful(): print("Test suite failed") diff --git a/silx/test/test_resources.py b/silx/test/test_resources.py index 66ac24f..8d3bd41 100644 --- a/silx/test/test_resources.py +++ b/silx/test/test_resources.py @@ -1,7 +1,7 @@ # coding: utf-8 # /*########################################################################## # -# Copyright (c) 2016 European Synchrotron Radiation Facility +# Copyright (c) 2016-2018 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -32,12 +32,13 @@ __date__ = "17/01/2018" import os import unittest import shutil +import socket import tempfile -from silx.third_party import six +import six + import silx.resources from .utils import utilstest -import socket class TestResources(unittest.TestCase): diff --git a/silx/test/utils.py b/silx/test/utils.py index bac415b..12bede9 100644 --- a/silx/test/utils.py +++ b/silx/test/utils.py @@ -30,7 +30,7 @@ __authors__ = ["T. Vincent"] __license__ = "MIT" -__date__ = "17/01/2018" +__date__ = "03/01/2019" import sys @@ -70,11 +70,11 @@ class _TestOptions(object): self.TEST_LOW_MEM = False """Skip tests using too much memory""" - def configure(self, parsed_options): + def configure(self, parsed_options=None): """Configure the TestOptions class from the command line arguments and the environment variables """ - if not parsed_options.gui: + if parsed_options is not None and not parsed_options.gui: self.WITH_QT_TEST = False self.WITH_QT_TEST_REASON = "Skipped by command line" elif os.environ.get('WITH_QT_TEST', 'True') == 'False': @@ -84,26 +84,30 @@ class _TestOptions(object): self.WITH_QT_TEST = False self.WITH_QT_TEST_REASON = "DISPLAY env variable not set" - if not parsed_options.opencl or os.environ.get('SILX_OPENCL', 'True') == 'False': + if (parsed_options is not None and not parsed_options.opencl) or os.environ.get('SILX_OPENCL', 'True') == 'False': self.WITH_OPENCL_TEST = False # That's an easy way to skip OpenCL tests # It disable the use of OpenCL on the full silx project os.environ['SILX_OPENCL'] = "False" - if not parsed_options.opengl: + if parsed_options is not None and not parsed_options.opengl: self.WITH_GL_TEST = False self.WITH_GL_TEST_REASON = "Skipped by command line" elif os.environ.get('WITH_GL_TEST', 'True') == 'False': self.WITH_GL_TEST = False self.WITH_GL_TEST_REASON = "Skipped by WITH_GL_TEST env var" - if parsed_options.low_mem or os.environ.get('SILX_TEST_LOW_MEM', 'True') == 'False': + if (parsed_options is not None and parsed_options.low_mem) or os.environ.get('SILX_TEST_LOW_MEM', 'True') == 'False': self.TEST_LOW_MEM = True if self.WITH_QT_TEST: - from silx.gui import qt - if sys.platform == "win32" and qt.qVersion() == "5.9.2": - self.SKIP_TEST_FOR_ISSUE_936 = True + try: + from silx.gui import qt + except ImportError: + pass + else: + if sys.platform == "win32" and qt.qVersion() == "5.9.2": + self.SKIP_TEST_FOR_ISSUE_936 = True def add_parser_argument(self, parser): """Add extrat arguments to the test argument parser |