mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Closes #21256: Printout of keyword args in deterministic order in mock calls.
Printout of keyword args should be in deterministic order in a mock function call. This will help to write better doctests.
This commit is contained in:
parent
85e4235c0e
commit
047f14c3c6
3 changed files with 10 additions and 1 deletions
|
@ -1206,6 +1206,12 @@ class MockTest(unittest.TestCase):
|
|||
with self.assertRaises(AssertionError):
|
||||
m.hello.assert_not_called()
|
||||
|
||||
#Issue21256 printout of keyword args should be in deterministic order
|
||||
def test_sorted_call_signature(self):
|
||||
m = Mock()
|
||||
m.hello(name='hello', daddy='hero')
|
||||
text = "call(daddy='hero', name='hello')"
|
||||
self.assertEquals(repr(m.hello.call_args), text)
|
||||
|
||||
def test_mock_add_spec(self):
|
||||
class _One(object):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue