[Python-checkins] python/dist/src/Lib/test test_copy.py, 1.11.8.1, 1.11.8.2

aleax at users.sourceforge.net aleax at users.sourceforge.net
Sun Feb 6 08:56:21 CET 2005


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20725/test
Modified Files:
 Tag: release23-maint
	test_copy.py 
Log Message:
fix bug 1114776
Index: test_copy.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_copy.py,v
retrieving revision 1.11.8.1
retrieving revision 1.11.8.2
diff -u -d -r1.11.8.1 -r1.11.8.2
--- test_copy.py	25 Jan 2005 12:52:18 -0000	1.11.8.1
+++ test_copy.py	6 Feb 2005 07:56:18 -0000	1.11.8.2
@@ -222,6 +222,23 @@
 x = C(23)
 self.assertEqual(copy.deepcopy(x), x)
 
+ def _nomro(self):
+ class C(type):
+ def __getattribute__(self, attr):
+ if attr == '__mro__':
+ raise AttributeError, "What, *me*, a __mro__? Nevah!"
+ return super(C, self).__getattribute__(attr)
+ class D(object):
+ __metaclass__ = C
+ return D()
+
+ def test_copy_mro(self):
+ x = self._nomro()
+ y = copy.copy(x)
+
+ def test_deepcopy_mro(self):
+ x = self._nomro()
+ y = copy.deepcopy(x)
 
 # The deepcopy() method
 def test_deepcopy_basic(self):


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /