Skip to content

Commit

Permalink
Add one more test
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Sep 18, 2024
1 parent e98fb62 commit 1affdd2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Lib/test/test_unittest/testmock/testmagicmethods.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,14 @@ def test_magic_mock_resets_manual_mocks(self):
self.assertEqual(list(iter(mm)), [])
self.assertIsInstance(mm.custom(), MagicMock)

def test_magic_mock_resets_manual_mocks_empty_iter(self):
mm = MagicMock()
mm.__iter__.return_value = []
self.assertEqual(list(iter(mm)), [])

mm.reset_mock(return_value=True)
self.assertEqual(list(iter(mm)), [])

def test_magic_methods_and_spec(self):
class Iterable(object):
def __iter__(self): pass
Expand Down

0 comments on commit 1affdd2

Please sign in to comment.