Commit ec27d917 authored by Mark Dickinson's avatar Mark Dickinson

Fix test_py3kwarn not to test for __cmp__-related DeprecationWarning.

parent 674648e3
...@@ -251,9 +251,7 @@ class TestPy3KWarnings(unittest.TestCase): ...@@ -251,9 +251,7 @@ class TestPy3KWarnings(unittest.TestCase):
# With object as the base class # With object as the base class
class WarnOnlyCmp(object): class WarnOnlyCmp(object):
def __cmp__(self, other): pass def __cmp__(self, other): pass
self.assertEqual(len(w.warnings), 1) self.assertEqual(len(w.warnings), 0)
self.assertWarning(None, w,
"Overriding __cmp__ blocks inheritance of __hash__ in 3.x")
w.reset() w.reset()
class WarnOnlyEq(object): class WarnOnlyEq(object):
def __eq__(self, other): pass def __eq__(self, other): pass
...@@ -264,9 +262,7 @@ class TestPy3KWarnings(unittest.TestCase): ...@@ -264,9 +262,7 @@ class TestPy3KWarnings(unittest.TestCase):
class WarnCmpAndEq(object): class WarnCmpAndEq(object):
def __cmp__(self, other): pass def __cmp__(self, other): pass
def __eq__(self, other): pass def __eq__(self, other): pass
self.assertEqual(len(w.warnings), 2) self.assertEqual(len(w.warnings), 1)
self.assertWarning(None, w.warnings[0],
"Overriding __cmp__ blocks inheritance of __hash__ in 3.x")
self.assertWarning(None, w, self.assertWarning(None, w,
"Overriding __eq__ blocks inheritance of __hash__ in 3.x") "Overriding __eq__ blocks inheritance of __hash__ in 3.x")
w.reset() w.reset()
...@@ -280,9 +276,7 @@ class TestPy3KWarnings(unittest.TestCase): ...@@ -280,9 +276,7 @@ class TestPy3KWarnings(unittest.TestCase):
def __hash__(self): pass def __hash__(self): pass
class WarnOnlyCmp(DefinesAllThree): class WarnOnlyCmp(DefinesAllThree):
def __cmp__(self, other): pass def __cmp__(self, other): pass
self.assertEqual(len(w.warnings), 1) self.assertEqual(len(w.warnings), 0)
self.assertWarning(None, w,
"Overriding __cmp__ blocks inheritance of __hash__ in 3.x")
w.reset() w.reset()
class WarnOnlyEq(DefinesAllThree): class WarnOnlyEq(DefinesAllThree):
def __eq__(self, other): pass def __eq__(self, other): pass
...@@ -293,9 +287,7 @@ class TestPy3KWarnings(unittest.TestCase): ...@@ -293,9 +287,7 @@ class TestPy3KWarnings(unittest.TestCase):
class WarnCmpAndEq(DefinesAllThree): class WarnCmpAndEq(DefinesAllThree):
def __cmp__(self, other): pass def __cmp__(self, other): pass
def __eq__(self, other): pass def __eq__(self, other): pass
self.assertEqual(len(w.warnings), 2) self.assertEqual(len(w.warnings), 1)
self.assertWarning(None, w.warnings[0],
"Overriding __cmp__ blocks inheritance of __hash__ in 3.x")
self.assertWarning(None, w, self.assertWarning(None, w,
"Overriding __eq__ blocks inheritance of __hash__ in 3.x") "Overriding __eq__ blocks inheritance of __hash__ in 3.x")
w.reset() w.reset()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment