1111class TestPy3KWarnings (unittest .TestCase ):
1212
1313 def test_type_inequality_comparisons (self ):
14- expected = 'type inequality comparisons not supported in 3.x. '
14+ expected = 'type inequality comparisons not supported in 3.x'
1515 with catch_warning () as w :
1616 self .assertWarning (int < str , w , expected )
1717 with catch_warning () as w :
1818 self .assertWarning (type < object , w , expected )
1919
2020 def test_object_inequality_comparisons (self ):
21- expected = 'comparing unequal types not supported in 3.x. '
21+ expected = 'comparing unequal types not supported in 3.x'
2222 with catch_warning () as w :
2323 self .assertWarning (str < [], w , expected )
2424 with catch_warning () as w :
2525 self .assertWarning (object () < (1 , 2 ), w , expected )
2626
2727 def test_dict_inequality_comparisons (self ):
28- expected = 'dict inequality comparisons not supported in 3.x. '
28+ expected = 'dict inequality comparisons not supported in 3.x'
2929 with catch_warning () as w :
3030 self .assertWarning ({} < {2 :3 }, w , expected )
3131 with catch_warning () as w :
@@ -36,7 +36,7 @@ def test_dict_inequality_comparisons(self):
3636 self .assertWarning ({2 :3 } >= {}, w , expected )
3737
3838 def test_cell_inequality_comparisons (self ):
39- expected = 'cell comparisons not supported in 3.x. '
39+ expected = 'cell comparisons not supported in 3.x'
4040 def f (x ):
4141 def g ():
4242 return x
@@ -49,7 +49,7 @@ def g():
4949 self .assertWarning (cell0 < cell1 , w , expected )
5050
5151 def test_code_inequality_comparisons (self ):
52- expected = 'code inequality comparisons not supported in 3.x. '
52+ expected = 'code inequality comparisons not supported in 3.x'
5353 def f (x ):
5454 pass
5555 def g (x ):
@@ -65,7 +65,7 @@ def g(x):
6565
6666 def test_builtin_function_or_method_comparisons (self ):
6767 expected = ('builtin_function_or_method '
68- 'inequality comparisons not supported in 3.x. ' )
68+ 'inequality comparisons not supported in 3.x' )
6969 func = eval
7070 meth = {}.get
7171 with catch_warning () as w :
@@ -81,7 +81,7 @@ def assertWarning(self, _, warning, expected_message):
8181 self .assertEqual (str (warning .message ), expected_message )
8282
8383 def test_sort_cmp_arg (self ):
84- expected = "In 3.x, the cmp argument is no longer supported. "
84+ expected = "the cmp argument is not supported in 3.x "
8585 lst = range (5 )
8686 cmp = lambda x ,y : - 1
8787
@@ -95,7 +95,7 @@ def test_sort_cmp_arg(self):
9595 self .assertWarning (sorted (lst , cmp ), w , expected )
9696
9797 def test_sys_exc_clear (self ):
98- expected = 'sys.exc_clear() not supported in 3.x. Use except clauses. '
98+ expected = 'sys.exc_clear() not supported in 3.x; use except clauses'
9999 with catch_warning () as w :
100100 self .assertWarning (sys .exc_clear (), w , expected )
101101
@@ -119,7 +119,7 @@ def set():
119119 self .assertWarning (set (), w , expected )
120120
121121 def test_buffer (self ):
122- expected = 'buffer will be removed in 3.x'
122+ expected = 'buffer() not supported in 3.x; use memoryview() '
123123 with catch_warning () as w :
124124 self .assertWarning (buffer ('a' ), w , expected )
125125
0 commit comments