summaryrefslogtreecommitdiffstats
path: root/Lib/test/mapping_tests.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-01-24 19:26:24 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-01-24 19:26:24 (GMT)
commite96159335f6bb26615b57f880bf90440ed0123e4 (patch)
tree273325221fdef15629ebc63287c4772a3af40879 /Lib/test/mapping_tests.py
parentf41d29a8ebc27aafc18b6850648f1faa918e0e5d (diff)
downloadcpython-e96159335f6bb26615b57f880bf90440ed0123e4.zip
cpython-e96159335f6bb26615b57f880bf90440ed0123e4.tar.gz
cpython-e96159335f6bb26615b57f880bf90440ed0123e4.tar.bz2
Merged revisions 77727 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r77727 | ezio.melotti | 2010-01-24 18:58:36 +0200 (Sun, 24 Jan 2010) | 1 line use assert[Not]IsInstance where appropriate ........
Diffstat (limited to 'Lib/test/mapping_tests.py')
-rw-r--r--Lib/test/mapping_tests.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/Lib/test/mapping_tests.py b/Lib/test/mapping_tests.py
index f446b39..d2b7a59 100644
--- a/Lib/test/mapping_tests.py
+++ b/Lib/test/mapping_tests.py
@@ -435,15 +435,13 @@ class TestMappingProtocol(BasicTestMappingProtocol):
self.assertEqual(dictlike().fromkeys('a'), {'a':None})
self.assertTrue(dictlike.fromkeys('a').__class__ is dictlike)
self.assertTrue(dictlike().fromkeys('a').__class__ is dictlike)
- # FIXME: the following won't work with UserDict, because it's an old style class
- # self.assertTrue(type(dictlike.fromkeys('a')) is dictlike)
+ self.assertTrue(type(dictlike.fromkeys('a')) is dictlike)
class mydict(self.type2test):
def __new__(cls):
return collections.UserDict()
ud = mydict.fromkeys('ab')
self.assertEqual(ud, {'a':None, 'b':None})
- # FIXME: the following won't work with UserDict, because it's an old style class
- # self.assertTrue(isinstance(ud, collections.UserDict))
+ self.assertIsInstance(ud, collections.UserDict)
self.assertRaises(TypeError, dict.fromkeys)
class Exc(Exception): pass
@@ -473,7 +471,7 @@ class TestMappingProtocol(BasicTestMappingProtocol):
self.assertEqual(d.copy(), {1:1, 2:2, 3:3})
d = self._empty_mapping()
self.assertEqual(d.copy(), d)
- self.assertTrue(isinstance(d.copy(), d.__class__))
+ self.assertIsInstance(d.copy(), d.__class__)
self.assertRaises(TypeError, d.copy, None)
def test_get(self):
@@ -571,7 +569,7 @@ class TestHashMappingProtocol(TestMappingProtocol):
return collections.UserDict()
ud = mydict.fromkeys('ab')
self.assertEqual(ud, {'a':None, 'b':None})
- self.assertTrue(isinstance(ud, collections.UserDict))
+ self.assertIsInstance(ud, collections.UserDict)
def test_pop(self):
TestMappingProtocol.test_pop(self)