Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4)

Side by Side Diff: Lib/test/test_cmd_line.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/test/test_cgitb.py ('k') | Lib/test/test_codecencodings_cn.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Tests invocation of the interpreter with various command line arguments 1 # Tests invocation of the interpreter with various command line arguments
2 # Most tests are executed with environment variables ignored 2 # Most tests are executed with environment variables ignored
3 # See test_cmd_line_script.py for testing of script execution 3 # See test_cmd_line_script.py for testing of script execution
4 4
5 import test.support, unittest 5 import test.support, unittest
6 import os 6 import os
7 import sys 7 import sys
8 import subprocess 8 import subprocess
9 import tempfile 9 import tempfile
10 from test.script_helper import spawn_python, kill_python, assert_python_ok, asse rt_python_failure 10 from test.script_helper import spawn_python, kill_python, assert_python_ok, asse rt_python_failure
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 # on Windows (sys.stdin is opened in binary mode) 251 # on Windows (sys.stdin is opened in binary mode)
252 self.check_input( 252 self.check_input(
253 "import sys; print(repr(sys.stdin.readline()))", 253 "import sys; print(repr(sys.stdin.readline()))",
254 b"'abc\\n'") 254 b"'abc\\n'")
255 255
256 def test_builtin_input(self): 256 def test_builtin_input(self):
257 # Issue #11272: check that input() strips newlines ('\n' or '\r\n') 257 # Issue #11272: check that input() strips newlines ('\n' or '\r\n')
258 self.check_input( 258 self.check_input(
259 "print(repr(input()))", 259 "print(repr(input()))",
260 b"'abc'") 260 b"'abc'")
261
262 def test_unmached_quote(self):
263 # Issue #10206: python program starting with unmatched quote
264 # spewed spaces to stdout
265 rc, out, err = assert_python_failure('-c', "'")
266 self.assertRegex(err.decode('ascii', 'ignore'), 'SyntaxError')
267 self.assertEqual(b'', out)
268 261
269 262
270 def test_main(): 263 def test_main():
271 test.support.run_unittest(CmdLineTest) 264 test.support.run_unittest(CmdLineTest)
272 test.support.reap_children() 265 test.support.reap_children()
273 266
274 if __name__ == "__main__": 267 if __name__ == "__main__":
275 test_main() 268 test_main()
OLDNEW
« no previous file with comments | « Lib/test/test_cgitb.py ('k') | Lib/test/test_codecencodings_cn.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+