Example #1
0
 def run(self):
     unload_sumpf()
     for l in self.__libnames:
         if not make_lib_unavailable(l):
             nu = self.namespace.not_unavailable
             nu.append(l)
             self.namespace.not_unavailable = nu
         unload_lib(l)
     import sumpf
     function = None
     if self.__function == MissingLibProcess.FILE_FORMATS:
         function = self.__CheckFileFormats
     elif self.__function == MissingLibProcess.MISSING_LIBS:
         function = self.__CheckMissingLibs
     self.namespace.result = function(sumpf, **self.__kwargs)
Example #2
0
    parser.add_argument("-N, --unload_numpy", dest="unload_numpy", action="store_true", default=False, help="Unload the NumPy library to see how SuMPF performs without it.")
    parser.add_argument("-r, --repetitions", dest="repetitions", action="store", type=int, default=1, metavar="N", help="The number of times, the tests are repeated.")
    args, unittest_args = parser.parse_known_args()
    sys.argv[1:] = unittest_args
    sumpf.config.set("run_incomplete_tests", args.run_incomplete_tests)
    sumpf.config.set("write_to_disk", args.write_to_disk)
    sumpf.config.set("test_gui", args.test_gui)
    sumpf.config.set("run_long_tests", args.run_long_tests)
    sumpf.config.set("run_time_variant_tests", args.run_time_variant_tests)
    sumpf.config.set("run_interactive_tests", args.run_interactive_tests)
    sumpf.config.set("modify_config", args.modify_config)
    sumpf.config.set("unload_numpy", args.unload_numpy)

# unload NumPy if requested
if sumpf.config.get("unload_numpy"):
    common.make_lib_unavailable("numpy")
    common.unload_sumpf()
    common.unload_lib("_common")
    import sumpf
    import _common as common
    sumpf.config.create_config(variables=config)

# print a notification when the gui shall be tested, but is not available
if (not hasattr(sumpf, "gui")) and (sumpf.config.get("test_gui") or sumpf.config.get("run_interactive_tests")):
    sumpf.config.set("test_gui", False)
    sumpf.config.set("run_interactive_tests", False)
    print("Tests of the GUI and interactive tests are skipped because of a missing library.")

# import the tests
from base import *
from data import *