Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add TODOs
  • Loading branch information
JaeyoungAhn committed Mar 26, 2023
commit 074e4b3144883cad2f39a5975d5b2310d38f52bc
15 changes: 15 additions & 0 deletions Lib/test/test_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ class TestPy2MigrationHint(unittest.TestCase):
if print statement is executed as in Python 2.
"""

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_normal_string(self):
python2_print_str = 'print "Hello World"'
with self.assertRaises(SyntaxError) as context:
Expand All @@ -143,6 +145,8 @@ def test_normal_string(self):
self.assertIn("Missing parentheses in call to 'print'. Did you mean print(...)",
str(context.exception))

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_string_with_soft_space(self):
python2_print_str = 'print "Hello World",'
with self.assertRaises(SyntaxError) as context:
Expand All @@ -151,6 +155,8 @@ def test_string_with_soft_space(self):
self.assertIn("Missing parentheses in call to 'print'. Did you mean print(...)",
str(context.exception))

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_string_with_excessive_whitespace(self):
python2_print_str = 'print "Hello World", '
with self.assertRaises(SyntaxError) as context:
Expand All @@ -159,6 +165,8 @@ def test_string_with_excessive_whitespace(self):
self.assertIn("Missing parentheses in call to 'print'. Did you mean print(...)",
str(context.exception))

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_string_with_leading_whitespace(self):
python2_print_str = '''if 1:
print "Hello World"
Expand All @@ -172,6 +180,9 @@ def test_string_with_leading_whitespace(self):
# bpo-32685: Suggestions for print statement should be proper when
# it is in the same line as the header of a compound statement
# and/or followed by a semicolon

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_string_with_semicolon(self):
python2_print_str = 'print p;'
with self.assertRaises(SyntaxError) as context:
Expand All @@ -180,6 +191,8 @@ def test_string_with_semicolon(self):
self.assertIn("Missing parentheses in call to 'print'. Did you mean print(...)",
str(context.exception))

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_string_in_loop_on_same_line(self):
python2_print_str = 'for i in s: print i'
with self.assertRaises(SyntaxError) as context:
Expand All @@ -188,6 +201,8 @@ def test_string_in_loop_on_same_line(self):
self.assertIn("Missing parentheses in call to 'print'. Did you mean print(...)",
str(context.exception))

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_stream_redirection_hint_for_py2_migration(self):
# Test correct hint produced for Py2 redirection syntax
with self.assertRaises(TypeError) as context:
Expand Down