This commit is contained in:
Michael Foord 2013-11-23 13:30:03 +00:00
commit 514afeb65c
1 changed files with 2 additions and 15 deletions

View File

@ -1302,20 +1302,6 @@ class MockTest(unittest.TestCase):
self.assertEqual(m.method_calls, [])
def test_attribute_deletion(self):
# this behaviour isn't *useful*, but at least it's now tested...
for Klass in Mock, MagicMock, NonCallableMagicMock, NonCallableMock:
m = Klass()
original = m.foo
m.foo = 3
del m.foo
self.assertEqual(m.foo, original)
new = m.foo = Mock()
del m.foo
self.assertEqual(m.foo, new)
def test_mock_parents(self):
for Klass in Mock, MagicMock:
m = Klass()
@ -1379,7 +1365,8 @@ class MockTest(unittest.TestCase):
def test_attribute_deletion(self):
for mock in Mock(), MagicMock():
for mock in (Mock(), MagicMock(), NonCallableMagicMock(),
NonCallableMock()):
self.assertTrue(hasattr(mock, 'm'))
del mock.m