[3.13] gh-65454: avoid triggering call to a PropertyMock in NonCallableMock.__setattr__ (GH-120019) (#120336)

gh-65454: avoid triggering call to a PropertyMock in NonCallableMock.__setattr__ (GH-120019)
(cherry picked from commit 9e9ee50421)

Co-authored-by: blhsing <blhsing@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-06-11 08:12:16 +02:00 committed by GitHub
parent aba5f2a4d1
commit 81eae21733
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 0 deletions

View file

@ -1127,6 +1127,14 @@ class TestCallList(unittest.TestCase):
p.assert_called_once_with()
def test_propertymock_attach(self):
m = Mock()
p = PropertyMock()
type(m).foo = p
m.attach_mock(p, 'foo')
self.assertEqual(m.mock_calls, [])
class TestCallablePredicate(unittest.TestCase):
def test_type(self):