aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/unittest/test/testmock/testmock.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-11-17 00:12:21 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2013-11-17 00:12:21 +0200
commit5665bc5980cd20252fe1d27807759cecee8594d0 (patch)
tree04c09b0879e10aa82e7023d916965206669e8475 /Lib/unittest/test/testmock/testmock.py
parent7c5e24f948e6ce33e21b09833f8fe3a8eb1530ac (diff)
downloadcpython-5665bc5980cd20252fe1d27807759cecee8594d0.tar.gz
cpython-5665bc5980cd20252fe1d27807759cecee8594d0.zip
Issue #19594: Use specific asserts in unittest tests.
Diffstat (limited to 'Lib/unittest/test/testmock/testmock.py')
-rw-r--r--Lib/unittest/test/testmock/testmock.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/unittest/test/testmock/testmock.py b/Lib/unittest/test/testmock/testmock.py
index 3d0776c16fb..cef5405fe95 100644
--- a/Lib/unittest/test/testmock/testmock.py
+++ b/Lib/unittest/test/testmock/testmock.py
@@ -52,7 +52,7 @@ class MockTest(unittest.TestCase):
"method_calls not initialised correctly")
# Can't use hasattr for this test as it always returns True on a mock
- self.assertFalse('_items' in mock.__dict__,
+ self.assertNotIn('_items', mock.__dict__,
"default mock should not have '_items' attribute")
self.assertIsNone(mock._mock_parent,
@@ -493,19 +493,19 @@ class MockTest(unittest.TestCase):
pass
mock = Mock(spec=X)
- self.assertTrue(isinstance(mock, X))
+ self.assertIsInstance(mock, X)
mock = Mock(spec=X())
- self.assertTrue(isinstance(mock, X))
+ self.assertIsInstance(mock, X)
self.assertIs(mock.__class__, X)
self.assertEqual(Mock().__class__.__name__, 'Mock')
mock = Mock(spec_set=X)
- self.assertTrue(isinstance(mock, X))
+ self.assertIsInstance(mock, X)
mock = Mock(spec_set=X())
- self.assertTrue(isinstance(mock, X))
+ self.assertIsInstance(mock, X)
def test_setting_attribute_with_spec_set(self):