mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
only order comparisons are removed in py3k #6119
This commit is contained in:
parent
0c6de43dd9
commit
1bf4765369
3 changed files with 20 additions and 7 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue