diff options
author | Raymond Hettinger <python@rcn.com> | 2003-03-12 04:25:42 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-03-12 04:25:42 (GMT) |
commit | 83245b58280a7679da0fe7216f36353e44ddf859 (patch) | |
tree | 882b53afe399536988d60f9f47e7b07e93f4a4d5 /Lib/test/test_descr.py | |
parent | 45c3941510e8ad29ed2ffa2cf8fa3c1c8f7c22e5 (diff) | |
download | cpython-83245b58280a7679da0fe7216f36353e44ddf859.zip cpython-83245b58280a7679da0fe7216f36353e44ddf859.tar.gz cpython-83245b58280a7679da0fe7216f36353e44ddf859.tar.bz2 |
SF bug #699934: Obscure error message
Clarify error message for mro conflicts.
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r-- | Lib/test/test_descr.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 946a529..d925c75 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -1062,6 +1062,10 @@ def consistency_with_epg(): (EditableScrollablePane, ScrollablePane, EditablePane, 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..." def raises(exc, expected, callable, *args): @@ -1079,9 +1083,9 @@ def mro_disagreement(): # Test some very simple errors raises(TypeError, "duplicate base class A", type, "X", (A, A), {}) - raises(TypeError, "MRO conflict among bases ", + raises(TypeError, mro_err_msg, type, "X", (A, B), {}) - raises(TypeError, "MRO conflict among bases ", + raises(TypeError, mro_err_msg, type, "X", (A, C, B), {}) # Test a slightly more complex error class GridLayout(object): pass @@ -1089,7 +1093,7 @@ def mro_disagreement(): class VerticalGrid(GridLayout): pass class HVGrid(HorizontalGrid, VerticalGrid): pass class VHGrid(VerticalGrid, HorizontalGrid): pass - raises(TypeError, "MRO conflict among bases ", + raises(TypeError, mro_err_msg, type, "ConfusedGrid", (HVGrid, VHGrid), {}) def objects(): |