Skip to content
Permalink
Browse files

Simpler solution

  • Loading branch information...
jngrad committed Aug 12, 2019
1 parent 7be8e6d commit 5853bd2f7c8f2f57bf2177dd5a4de9114f41d785
Showing with 2 additions and 15 deletions.
  1. +0 −9 src/python/espressomd/__init__.py
  2. +2 −6 testsuite/python/unittest_decorators.py
@@ -58,15 +58,6 @@ def missing_features(*args):
return set(args) - set(features())


def unknown_features(*args):
"""Returns a list of the unknown features in the argument"""

if len(args) == 1 and not isinstance(args[0], str) and hasattr(args[0], "__iter__"):
return set(args[0]) - set(all_features())

return set(args) - set(all_features())


def assert_features(*args):
"""Raises an exception when a list of features is not a subset of the compiled-in features"""

@@ -26,12 +26,8 @@ def _id(x):
def skipIfMissingFeatures(*args):
"""Unittest skipIf decorator for missing Espresso features."""

unknown_features = espressomd.unknown_features(*args)
if unknown_features:
raise ValueError("Unknown features " + ", ".join(unknown_features))

missing_features = espressomd.missing_features(*args)
if missing_features:
if not espressomd.has_features(*args):
missing_features = espressomd.missing_features(*args)
return unittest.skip("Skipping test: missing feature{} {}".format(
's' if len(missing_features) else '', ', '.join(missing_features)))
return _id

0 comments on commit 5853bd2

Please sign in to comment.
You can’t perform that action at this time.