mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
support assertNotIn for unittest
This commit is contained in:
parent
34dedcde2d
commit
07db54e02e
@ -65,6 +65,10 @@ class TestCase:
|
||||
def assertIn(self, x, y):
|
||||
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):
|
||||
|
@ -65,6 +65,10 @@ class TestCase:
|
||||
def assertIn(self, x, y):
|
||||
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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user