diff options
author | Kushal Das <kushaldas@gmail.com> | 2014-04-15 19:35:50 (GMT) |
---|---|---|
committer | Kushal Das <kushaldas@gmail.com> | 2014-04-15 19:35:50 (GMT) |
commit | 484f8a875b986690f9d8aec2089368b70184e009 (patch) | |
tree | 6953671c7a532c265b20f74fa67d7f969f4d9c79 /Lib/unittest/test/testmock | |
parent | 9574355ff3cffde2dc67ee60a61e468cec1d46f7 (diff) | |
download | cpython-484f8a875b986690f9d8aec2089368b70184e009.zip cpython-484f8a875b986690f9d8aec2089368b70184e009.tar.gz cpython-484f8a875b986690f9d8aec2089368b70184e009.tar.bz2 |
Closes Issue 21222.
Passing name keyword argument to mock.create_autospec now works.
Diffstat (limited to 'Lib/unittest/test/testmock')
-rw-r--r-- | Lib/unittest/test/testmock/testmock.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/unittest/test/testmock/testmock.py b/Lib/unittest/test/testmock/testmock.py index 70f19d3..23675b9 100644 --- a/Lib/unittest/test/testmock/testmock.py +++ b/Lib/unittest/test/testmock/testmock.py @@ -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): |