Skip to content

Commit b36f292

Browse files
committed
unittest: Add skipIf decorator.
1 parent 49140d6 commit b36f292

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

unittest/unittest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ def _inner(self):
133133
return _inner
134134
return _decor
135135

136+
def skipIf(cond, msg):
137+
if not cond:
138+
return lambda x: x
139+
return skip(msg)
136140

137141
def skipUnless(cond, msg):
138142
if cond:

0 commit comments

Comments
 (0)