def runtest(self): disable_matplotlib() os.chdir(self.parent.fspath.dirname) sys.path.append(self.parent.fspath.dirname) spec = importlib.util.spec_from_file_location(self.name, str(self.parent.fspath)) module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) enable_matplotlib()
def runtest(self): disable_matplotlib() original_runtest() enable_matplotlib()