From 08a674fae489403733ae01ea5c333a8f8d15ece0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Fri, 18 Dec 2020 09:33:08 +0100 Subject: [PATCH] tests: Make decorator function public --- testsuite/python/h5md.py | 2 +- testsuite/python/lb_vtk.py | 2 +- testsuite/python/mdanalysis.py | 2 +- testsuite/python/unittest_decorators.py | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/testsuite/python/h5md.py b/testsuite/python/h5md.py index db660973e33..b1aae7dab3c 100644 --- a/testsuite/python/h5md.py +++ b/testsuite/python/h5md.py @@ -30,7 +30,7 @@ import espressomd.io.writer try: import h5py # h5py has to be imported *after* espressomd (MPI) - skipIfMissingPythonPackage = utx._id + skipIfMissingPythonPackage = utx.no_skip except ImportError: skipIfMissingPythonPackage = ut.skip( "Python module h5py not available, skipping test!") diff --git a/testsuite/python/lb_vtk.py b/testsuite/python/lb_vtk.py index 9ba2726553d..e5091528b25 100644 --- a/testsuite/python/lb_vtk.py +++ b/testsuite/python/lb_vtk.py @@ -25,7 +25,7 @@ try: import vtk from vtk.util import numpy_support as VN - skipIfMissingPythonPackage = utx._id + skipIfMissingPythonPackage = utx.no_skip except ImportError: skipIfMissingPythonPackage = ut.skip( "Python module vtk not available, skipping test!") diff --git a/testsuite/python/mdanalysis.py b/testsuite/python/mdanalysis.py index 4c7c11b3dd1..1ef93e11c5b 100644 --- a/testsuite/python/mdanalysis.py +++ b/testsuite/python/mdanalysis.py @@ -28,7 +28,7 @@ try: import MDAnalysis as mda from espressomd import MDA_ESP - skipIfMissingPythonPackage = utx._id + skipIfMissingPythonPackage = utx.no_skip except ImportError: skipIfMissingPythonPackage = ut.skip( "Python module MDAnalysis not available, skipping test!") diff --git a/testsuite/python/unittest_decorators.py b/testsuite/python/unittest_decorators.py index 690e9e0e05e..fb515578570 100644 --- a/testsuite/python/unittest_decorators.py +++ b/testsuite/python/unittest_decorators.py @@ -22,7 +22,7 @@ import espressomd -def _id(x): +def no_skip(x): return x @@ -32,7 +32,7 @@ def skipIfMissingFeatures(*args): missing_features = espressomd.missing_features(*args) return unittest.skip("Skipping test: missing feature{} {}".format( 's' if missing_features else '', ', '.join(missing_features))) - return _id + return no_skip def skipIfMissingModules(*args): @@ -46,14 +46,14 @@ def skipIfMissingModules(*args): if missing_modules: return unittest.skip("Skipping test: missing python module{} {}".format( 's' if missing_modules else '', ', '.join(missing_modules))) - return _id + return no_skip def skipIfMissingGPU(): """Unittest skipIf decorator for missing GPU.""" if not espressomd.gpu_available(): return unittest.skip("Skipping test: no GPU available") - return _id + return no_skip def skipIfUnmetModuleVersionRequirement(module, version_requirement): @@ -66,4 +66,4 @@ def skipIfUnmetModuleVersionRequirement(module, version_requirement): version_requirement).contains(_module.__version__): return unittest.skip( "Skipping test: version requirement not met for module {}".format(module)) - return _id + return no_skip