[Python-checkins] python/dist/src/Lib/test test_descr.py,1.169,1.170
gvanrossum@users.sourceforge.net
gvanrossum@users.sourceforge.net
Fri, 13 Dec 2002 09:49:47 -0800
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv7366/Lib/test
Modified Files:
test_descr.py
Log Message:
Tighten the tests for assignment to __bases__: disallow empty tuple.
Index: test_descr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v
retrieving revision 1.169
retrieving revision 1.170
diff -C2 -d -r1.169 -r1.170
*** test_descr.py 9 Dec 2002 22:56:13 -0000 1.169
--- test_descr.py 13 Dec 2002 17:49:38 -0000 1.170
***************
*** 3487,3490 ****
--- 3487,3498 ----
try:
+ D.__bases__ = ()
+ except TypeError, msg:
+ if str(msg) == "a new-style class can't have only classic bases":
+ raise TestFailed, "wrong error message for .__bases__ = ()"
+ else:
+ raise TestFailed, "shouldn't be able to set .__bases__ to ()"
+
+ try:
D.__bases__ = (D,)
except TypeError: