Message197424
In Lib/unittest/test/testmock/testmock.py, there are two test_attribute_deletion. One of them is overshadowed (not executed) by the other.
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_attribute_deletion(self):
for mock in Mock(), MagicMock():
self.assertTrue(hasattr(mock, 'm'))
del mock.m
self.assertFalse(hasattr(mock, 'm'))
del mock.f
self.assertFalse(hasattr(mock, 'f'))
self.assertRaises(AttributeError, getattr, mock, 'f')
They are testing the same thing but with different expectations. The first one is invalid and should be removed. The patch altered a bit of the second test to incorporate more mock classes. |
|
Date |
User |
Action |
Args |
2013-09-10 06:55:03 | vajrasky | set | recipients:
+ vajrasky |
2013-09-10 06:55:03 | vajrasky | set | messageid: <1378796103.81.0.419617172609.issue18993@psf.upfronthosting.co.za> |
2013-09-10 06:55:03 | vajrasky | link | issue18993 messages |
2013-09-10 06:55:03 | vajrasky | create | |
|