Skip to content
Permalink
Browse files

Detect unknown features in the testsuite

  • Loading branch information...
jngrad committed Aug 12, 2019
1 parent da6b58d commit 3fc61715139e869ee5767f0f620a90d6f107b5a2
Showing with 13 additions and 0 deletions.
  1. +9 −0 src/python/espressomd/__init__.py
  2. +4 −0 testsuite/python/unittest_decorators.py
@@ -58,6 +58,15 @@ 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,6 +26,10 @@ 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:
return unittest.skip("Skipping test: missing feature{} {}".format(

0 comments on commit 3fc6171

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