summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_py3kwarn.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2008-09-03 22:45:11 (GMT)
committerBrett Cannon <bcannon@gmail.com>2008-09-03 22:45:11 (GMT)
commita0b7444f68ae5478f5553dcddea7ff44f283b25b (patch)
tree899b4886a0111a0f16fb584dd4353feb8b9e84a3 /Lib/test/test_py3kwarn.py
parentc585df94766702ac6d6f3f0d27ad5d07e5546164 (diff)
downloadcpython-a0b7444f68ae5478f5553dcddea7ff44f283b25b.zip
cpython-a0b7444f68ae5478f5553dcddea7ff44f283b25b.tar.gz
cpython-a0b7444f68ae5478f5553dcddea7ff44f283b25b.tar.bz2
test_py3kwarn had been overlooked when test.test_support.catch_warning() was
re-implemented to use warnings.catch_warnings() and had its API improved. Closes issue #3768. Code review by Benjamin Peterson.
Diffstat (limited to 'Lib/test/test_py3kwarn.py')
-rw-r--r--Lib/test/test_py3kwarn.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py
index 8fa6135..7bfe1e5 100644
--- a/Lib/test/test_py3kwarn.py
+++ b/Lib/test/test_py3kwarn.py
@@ -220,28 +220,28 @@ class TestPy3KWarnings(unittest.TestCase):
# With object as the base class
class WarnOnlyCmp(object):
def __cmp__(self, other): pass
- self.assertEqual(len(w.warnings), 1)
+ self.assertEqual(len(w), 1)
self.assertWarning(None, w,
"Overriding __cmp__ blocks inheritance of __hash__ in 3.x")
w.reset()
class WarnOnlyEq(object):
def __eq__(self, other): pass
- self.assertEqual(len(w.warnings), 1)
+ self.assertEqual(len(w), 1)
self.assertWarning(None, w,
"Overriding __eq__ blocks inheritance of __hash__ in 3.x")
w.reset()
class WarnCmpAndEq(object):
def __cmp__(self, other): pass
def __eq__(self, other): pass
- self.assertEqual(len(w.warnings), 2)
- self.assertWarning(None, w.warnings[-2],
+ self.assertEqual(len(w), 2)
+ self.assertWarning(None, w[-2],
"Overriding __cmp__ blocks inheritance of __hash__ in 3.x")
self.assertWarning(None, w,
"Overriding __eq__ blocks inheritance of __hash__ in 3.x")
w.reset()
class NoWarningOnlyHash(object):
def __hash__(self): pass
- self.assertEqual(len(w.warnings), 0)
+ self.assertEqual(len(w), 0)
# With an intermediate class in the heirarchy
class DefinesAllThree(object):
def __cmp__(self, other): pass
@@ -249,28 +249,28 @@ class TestPy3KWarnings(unittest.TestCase):
def __hash__(self): pass
class WarnOnlyCmp(DefinesAllThree):
def __cmp__(self, other): pass
- self.assertEqual(len(w.warnings), 1)
+ self.assertEqual(len(w), 1)
self.assertWarning(None, w,
"Overriding __cmp__ blocks inheritance of __hash__ in 3.x")
w.reset()
class WarnOnlyEq(DefinesAllThree):
def __eq__(self, other): pass
- self.assertEqual(len(w.warnings), 1)
+ self.assertEqual(len(w), 1)
self.assertWarning(None, w,
"Overriding __eq__ blocks inheritance of __hash__ in 3.x")
w.reset()
class WarnCmpAndEq(DefinesAllThree):
def __cmp__(self, other): pass
def __eq__(self, other): pass
- self.assertEqual(len(w.warnings), 2)
- self.assertWarning(None, w.warnings[-2],
+ self.assertEqual(len(w), 2)
+ self.assertWarning(None, w[-2],
"Overriding __cmp__ blocks inheritance of __hash__ in 3.x")
self.assertWarning(None, w,
"Overriding __eq__ blocks inheritance of __hash__ in 3.x")
w.reset()
class NoWarningOnlyHash(DefinesAllThree):
def __hash__(self): pass
- self.assertEqual(len(w.warnings), 0)
+ self.assertEqual(len(w), 0)
class TestStdlibRemovals(unittest.TestCase):