Closes Issue 21222.

Passing name keyword argument to mock.create_autospec now works.
This commit is contained in:
Kushal Das 2014-04-16 01:05:50 +05:30
parent 9574355ff3
commit 484f8a875b
3 changed files with 9 additions and 0 deletions

View file

@ -1182,6 +1182,10 @@ class MockTest(unittest.TestCase):
func.mock_calls, [call(1, 2), call(3, 4)]
)
#Issue21222
def test_create_autospec_with_name(self):
m = mock.create_autospec(object(), name='sweet_func')
self.assertIn('sweet_func', repr(m))
def test_mock_add_spec(self):
class _One(object):