mirror of https://github.com/python/cpython
Document use of ANY in test assertions (GH-94060)
This commit is contained in:
parent
b9a9e3dd62
commit
04005f5021
|
@ -2426,6 +2426,14 @@ passed in.
|
|||
>>> m.mock_calls == [call(1), call(1, 2), ANY]
|
||||
True
|
||||
|
||||
:data:`ANY` is not limited to comparisons with call objects and so
|
||||
can also be used in test assertions::
|
||||
|
||||
class TestStringMethods(unittest.TestCase):
|
||||
|
||||
def test_split(self):
|
||||
s = 'hello world'
|
||||
self.assertEqual(s.split(), ['hello', ANY])
|
||||
|
||||
|
||||
FILTER_DIR
|
||||
|
|
Loading…
Reference in New Issue