summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_py3kwarn.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-07-02 17:06:17 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-07-02 17:06:17 (GMT)
commit1bf4765369d7a6d5f0a4ad616f8a887c8fc4af39 (patch)
tree84164ea8c9c2e369ca524aff80b9476efe1e0f11 /Lib/test/test_py3kwarn.py
parent0c6de43dd936327ab4c57338c5e20f6e8824e7ee (diff)
downloadcpython-1bf4765369d7a6d5f0a4ad616f8a887c8fc4af39.zip
cpython-1bf4765369d7a6d5f0a4ad616f8a887c8fc4af39.tar.gz
cpython-1bf4765369d7a6d5f0a4ad616f8a887c8fc4af39.tar.bz2
only order comparisons are removed in py3k #6119
Diffstat (limited to 'Lib/test/test_py3kwarn.py')
-rw-r--r--Lib/test/test_py3kwarn.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py
index f510d93..eb05303 100644
--- a/Lib/test/test_py3kwarn.py
+++ b/Lib/test/test_py3kwarn.py
@@ -21,6 +21,9 @@ class TestPy3KWarnings(unittest.TestCase):
def assertWarning(self, _, warning, expected_message):
self.assertEqual(str(warning.message), expected_message)
+ def assertNoWarning(self, _, recorder):
+ self.assertEqual(len(recorder.warnings), 0)
+
def test_backquote(self):
expected = 'backquote not supported in 3.x; use repr()'
with check_warnings() as w:
@@ -113,7 +116,7 @@ class TestPy3KWarnings(unittest.TestCase):
def test_builtin_function_or_method_comparisons(self):
expected = ('builtin_function_or_method '
- 'inequality comparisons not supported in 3.x')
+ 'order comparisons not supported in 3.x')
func = eval
meth = {}.get
with check_warnings() as w:
@@ -124,6 +127,12 @@ class TestPy3KWarnings(unittest.TestCase):
self.assertWarning(meth <= func, w, expected)
w.reset()
self.assertWarning(meth >= func, w, expected)
+ w.reset()
+ self.assertNoWarning(meth == func, w)
+ self.assertNoWarning(meth != func, w)
+ lam = lambda x: x
+ self.assertNoWarning(lam == func, w)
+ self.assertNoWarning(lam != func, w)
def test_frame_attributes(self):
template = "%s has been removed in 3.x"