mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
support assertNotIn for unittest
This commit is contained in:
parent
34dedcde2d
commit
07db54e02e
@ -66,6 +66,10 @@ class TestCase:
|
||||
msg = "Expected %r to be in %r" % (x, y)
|
||||
assert x in y, msg
|
||||
|
||||
def assertNotIn(self, x, y):
|
||||
msg = "Expected %r not to be in %r" % (x, y)
|
||||
assert x not in y, msg
|
||||
|
||||
def run(self, result: TestResult, suite_name):
|
||||
for name in dir(self):
|
||||
if name.startswith("test"):
|
||||
|
@ -66,6 +66,10 @@ class TestCase:
|
||||
msg = "Expected %r to be in %r" % (x, y)
|
||||
assert x in y, msg
|
||||
|
||||
def assertNotIn(self, x, y):
|
||||
msg = "Expected %r not to be in %r" % (x, y)
|
||||
assert x not in y, msg
|
||||
|
||||
def run(self, result: TestResult, suite_name):
|
||||
for name in dir(self):
|
||||
if name.startswith("test"):
|
||||
|
Loading…
x
Reference in New Issue
Block a user