[Python-checkins] python/dist/src/Lib/test test_descr.py,1.186,1.187

rhettinger@users.sourceforge.net rhettinger@users.sourceforge.net
Tue, 11 Mar 2003 20:25:44 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv4713/Lib/test

Modified Files:
	test_descr.py 
Log Message:
SF bug #699934: Obscure error message

Clarify error message for mro conflicts.


Index: test_descr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v
retrieving revision 1.186
retrieving revision 1.187
diff -C2 -d -r1.186 -r1.187
*** test_descr.py	27 Feb 2003 20:04:19 -0000	1.186
--- test_descr.py	12 Mar 2003 04:25:42 -0000	1.187
***************
*** 1063,1066 ****
--- 1063,1070 ----
             Pane, ScrollingMixin, EditingMixin, object))
  
+ mro_err_msg = """Cannot create class.The superclasses have conflicting
+ inheritance trees which leave the method resolution order (MRO)
+ undefined for bases """
+ 
  def mro_disagreement():
      if verbose: print "Testing error messages for MRO disagreement..."
***************
*** 1080,1086 ****
      raises(TypeError, "duplicate base class A",
             type, "X", (A, A), {})
!     raises(TypeError, "MRO conflict among bases ",
             type, "X", (A, B), {})
!     raises(TypeError, "MRO conflict among bases ",
             type, "X", (A, C, B), {})
      # Test a slightly more complex error
--- 1084,1090 ----
      raises(TypeError, "duplicate base class A",
             type, "X", (A, A), {})
!     raises(TypeError, mro_err_msg,
             type, "X", (A, B), {})
!     raises(TypeError, mro_err_msg,
             type, "X", (A, C, B), {})
      # Test a slightly more complex error
***************
*** 1090,1094 ****
      class HVGrid(HorizontalGrid, VerticalGrid): pass
      class VHGrid(VerticalGrid, HorizontalGrid): pass
!     raises(TypeError, "MRO conflict among bases ",
             type, "ConfusedGrid", (HVGrid, VHGrid), {})
  
--- 1094,1098 ----
      class HVGrid(HorizontalGrid, VerticalGrid): pass
      class VHGrid(VerticalGrid, HorizontalGrid): pass
!     raises(TypeError, mro_err_msg,
             type, "ConfusedGrid", (HVGrid, VHGrid), {})