From 047f6bd215d8f3b7e7283be9f0e5b670bd5caa52 2012-08-26 06:45:44 From: Jörgen Stenarson Date: 2012-08-26 06:45:44 Subject: [PATCH] Adding tests expecting windows lineendings. --- diff --git a/IPython/testing/tests/test_tools.py b/IPython/testing/tests/test_tools.py index 3c79ec9..7beb1f0 100644 --- a/IPython/testing/tests/test_tools.py +++ b/IPython/testing/tests/test_tools.py @@ -100,6 +100,15 @@ class Test_ipexec_validate(unittest.TestCase, tt.TempFileMixin): out = "A\nB" tt.ipexec_validate(self.fname, out) + def test_main_path2(self): + """Test with only stdout results, expecting windows line endings. + """ + self.mktmp("print('A')\n" + "print('B')\n" + ) + out = "A\r\nB" + tt.ipexec_validate(self.fname, out) + def test_exception_path(self): """Test exception path in exception_validate. """ @@ -112,3 +121,16 @@ class Test_ipexec_validate(unittest.TestCase, tt.TempFileMixin): ) out = "A\nB" tt.ipexec_validate(self.fname, expected_out=out, expected_err="C\nD") + + def test_exception_path(self): + """Test exception path in exception_validate, expecting windows line endings. + """ + self.mktmp("from __future__ import print_function\n" + "import sys\n" + "print('A')\n" + "print('B')\n" + "print('C', file=sys.stderr)\n" + "print('D', file=sys.stderr)\n" + ) + out = "A\r\nB" + tt.ipexec_validate(self.fname, expected_out=out, expected_err="C\r\nD")