]> arthur.ath.cx Git - bup.git/blobdiff - test/lib/wvpytest.py
wvpytest: add fail_value argument to wvpass and wvpasseq
[bup.git] / test / lib / wvpytest.py
index 523a3de51de5c45eade16c605f3eb90d0042cfd2..63eaa34f954117e90e7a54a745ca1ec372d8f5b1 100644 (file)
@@ -1,13 +1,19 @@
 import pytest
 
-def WVPASS(cond = True):
-    assert cond
+def WVPASS(cond = True, fail_value=None):
+    if fail_value:
+        assert cond, fail_value
+    else:
+        assert cond
 
 def WVFAIL(cond = True):
     assert not cond
 
-def WVPASSEQ(a, b):
-    assert a == b
+def WVPASSEQ(a, b, fail_value=None):
+    if fail_value:
+        assert a == b, fail_value
+    else:
+        assert a == b
 
 def WVPASSNE(a, b):
     assert a != b