mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Fix exception when calling reset_mock on a mock created with autospec
This commit is contained in:
parent
afc0c77b42
commit
75963643b1
3 changed files with 18 additions and 0 deletions
|
@ -355,6 +355,13 @@ class SpecSignatureTest(unittest.TestCase):
|
|||
self.assertEqual(mock(), 'foo')
|
||||
|
||||
|
||||
def test_autospec_reset_mock(self):
|
||||
m = create_autospec(int)
|
||||
int(m)
|
||||
m.reset_mock()
|
||||
self.assertEqual(m.__int__.call_count, 0)
|
||||
|
||||
|
||||
def test_mocking_unbound_methods(self):
|
||||
class Foo(object):
|
||||
def foo(self, foo):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue