Add a new require type, "lambda" which will require the Python lambda
expression to return a truthy value.
- command2
- ...
+ # Require the output of a Python expression to be true. For example,
+ # this will run on all platforms other than win32.
+ lambda: "sys.platform != win32"
+
skip:
# Skip a test if a feature is present, with a message that is logged.
- feature: RUST
elif key == "pcap":
# A valid requires argument, but not verified here.
pass
+ elif key == "lambda":
+ if not eval(requires["lambda"]):
+ raise UnsatisfiedRequirementError(requires["lambda"])
else:
raise Exception("unknown requires types: %s" % (key))