mirror of https://github.com/python/cpython.git
[3.11] Document use of ANY in test assertions (GH-94060) (GH-115608)
(cherry picked from commit 04005f5021
)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
This commit is contained in:
parent
51b974b0ab
commit
a6776cdc53
|
@ -2375,6 +2375,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