Skip to content

Commit

Permalink
tests: Make decorator function public
Browse files Browse the repository at this point in the history
  • Loading branch information
jngrad committed Dec 18, 2020
1 parent 9de3f1e commit 08a674f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion testsuite/python/h5md.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!")
Expand Down
2 changes: 1 addition & 1 deletion testsuite/python/lb_vtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!")
Expand Down
2 changes: 1 addition & 1 deletion testsuite/python/mdanalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!")
Expand Down
10 changes: 5 additions & 5 deletions testsuite/python/unittest_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import espressomd


def _id(x):
def no_skip(x):
return x


Expand All @@ -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):
Expand All @@ -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):
Expand All @@ -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

0 comments on commit 08a674f

Please sign in to comment.