We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a0472e1 commit 2953de9Copy full SHA for 2953de9
Lib/unittest/__init__.py
@@ -96,3 +96,19 @@ def __getattr__(name):
96
from .async_case import IsolatedAsyncioTestCase
97
return IsolatedAsyncioTestCase
98
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
99
+
100
101
+# XXX: RUSTPYTHON
102
+# This is very useful to reduce platform difference boilerplates in tests.
103
+def expectedFailureIf(condition, reason):
104
+ assert reason.startswith("TODO: RUSTPYTHON")
105
+ if condition:
106
+ return expectedFailure
107
+ else:
108
+ return lambda x: x
109
110
111
+# Even more useful because most of them are windows only.
112
+def expectedFailureIfWindows(reason):
113
+ import sys
114
+ return expectedFailureIf(sys.platform == 'win32', reason)
0 commit comments