summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_unittest.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-10-04 20:19:21 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-10-04 20:19:21 (GMT)
commit6e8c75755a1bb0cd8fb79944a8617802aa0c4e44 (patch)
tree03d732d40f80da6edce6c895d0876c5add347e59 /Lib/test/test_unittest.py
parent23c5050b25be66646af4d8a8fc2f9338a51e226a (diff)
downloadcpython-6e8c75755a1bb0cd8fb79944a8617802aa0c4e44.zip
cpython-6e8c75755a1bb0cd8fb79944a8617802aa0c4e44.tar.gz
cpython-6e8c75755a1bb0cd8fb79944a8617802aa0c4e44.tar.bz2
Merged revisions 74865,75175,75180 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r74865 | georg.brandl | 2009-09-17 02:49:37 -0500 (Thu, 17 Sep 2009) | 1 line #6912: add "with" block support to pindent. ........ r75175 | georg.brandl | 2009-10-01 15:11:14 -0500 (Thu, 01 Oct 2009) | 1 line Fix some weird whitespace and two other overlong lines. ........ r75180 | georg.brandl | 2009-10-01 15:59:31 -0500 (Thu, 01 Oct 2009) | 1 line #7031: Add TestCase.assertIsInstance and negated method. ........
Diffstat (limited to 'Lib/test/test_unittest.py')
-rw-r--r--Lib/test/test_unittest.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_unittest.py b/Lib/test/test_unittest.py
index 108802d..120a90d 100644
--- a/Lib/test/test_unittest.py
+++ b/Lib/test/test_unittest.py
@@ -2510,6 +2510,18 @@ class Test_TestCase(TestCase, TestEquality, TestHashing):
self.assertIsNot(thing, object())
self.assertRaises(self.failureException, self.assertIsNot, thing, thing)
+ def testAssertIsInstance(self):
+ thing = []
+ self.assertIsInstance(thing, list)
+ self.assertRaises(self.failureException, self.assertIsInstance,
+ thing, dict)
+
+ def testAssertNotIsInstance(self):
+ thing = []
+ self.assertNotIsInstance(thing, dict)
+ self.assertRaises(self.failureException, self.assertNotIsInstance,
+ thing, list)
+
def testAssertIn(self):
animals = {'monkey': 'banana', 'cow': 'grass', 'seal': 'fish'}