diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-07-02 17:19:22 +0000 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-07-02 17:19:22 +0000 |
commit | f92146938377651100db8a00bb3356ceff760037 (patch) | |
tree | 5ce1689d4ea682c943dd07212ada086bdc4778b8 /Lib/test/test_py3kwarn.py | |
parent | 585ad8ae5e352c99bbd87955c64cc9a0654da8c3 (diff) | |
download | cpython-git-f92146938377651100db8a00bb3356ceff760037.tar.gz |
Merged revisions 73774 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r73774 | benjamin.peterson | 2009-07-02 12:06:17 -0500 (Thu, 02 Jul 2009) | 1 line
only order comparisons are removed in py3k #6119
........
Diffstat (limited to 'Lib/test/test_py3kwarn.py')
-rw-r--r-- | Lib/test/test_py3kwarn.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py index 0afa8e72b1..6d8863ad7b 100644 --- a/Lib/test/test_py3kwarn.py +++ b/Lib/test/test_py3kwarn.py @@ -22,6 +22,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: @@ -132,7 +135,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: @@ -143,6 +146,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_sort_cmp_arg(self): expected = "the cmp argument is not supported in 3.x" |