| OLD | NEW |
| 1 import unittest | 1 import unittest |
| 2 from test import support | 2 from test import support |
| 3 import subprocess | 3 import subprocess |
| 4 import sys | 4 import sys |
| 5 import signal | 5 import signal |
| 6 import io | 6 import io |
| 7 import os | 7 import os |
| 8 import errno | 8 import errno |
| 9 import tempfile | 9 import tempfile |
| 10 import time | 10 import time |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 182 |
| 183 def test_stderr_none(self): | 183 def test_stderr_none(self): |
| 184 # .stderr is None when not redirected | 184 # .stderr is None when not redirected |
| 185 p = subprocess.Popen([sys.executable, "-c", 'print("banana")'], | 185 p = subprocess.Popen([sys.executable, "-c", 'print("banana")'], |
| 186 stdin=subprocess.PIPE, stdout=subprocess.PIPE) | 186 stdin=subprocess.PIPE, stdout=subprocess.PIPE) |
| 187 self.addCleanup(p.stdout.close) | 187 self.addCleanup(p.stdout.close) |
| 188 self.addCleanup(p.stdin.close) | 188 self.addCleanup(p.stdin.close) |
| 189 p.wait() | 189 p.wait() |
| 190 self.assertEqual(p.stderr, None) | 190 self.assertEqual(p.stderr, None) |
| 191 | 191 |
| 192 @unittest.skipIf(sys.base_prefix != sys.prefix, | |
| 193 'Test is not venv-compatible') | |
| 194 def test_executable_with_cwd(self): | 192 def test_executable_with_cwd(self): |
| 195 python_dir = os.path.dirname(os.path.realpath(sys.executable)) | 193 python_dir = os.path.dirname(os.path.realpath(sys.executable)) |
| 196 p = subprocess.Popen(["somethingyoudonthave", "-c", | 194 p = subprocess.Popen(["somethingyoudonthave", "-c", |
| 197 "import sys; sys.exit(47)"], | 195 "import sys; sys.exit(47)"], |
| 198 executable=sys.executable, cwd=python_dir) | 196 executable=sys.executable, cwd=python_dir) |
| 199 p.wait() | 197 p.wait() |
| 200 self.assertEqual(p.returncode, 47) | 198 self.assertEqual(p.returncode, 47) |
| 201 | 199 |
| 202 @unittest.skipIf(sys.base_prefix != sys.prefix, | |
| 203 'Test is not venv-compatible') | |
| 204 @unittest.skipIf(sysconfig.is_python_build(), | 200 @unittest.skipIf(sysconfig.is_python_build(), |
| 205 "need an installed Python. See #7774") | 201 "need an installed Python. See #7774") |
| 206 def test_executable_without_cwd(self): | 202 def test_executable_without_cwd(self): |
| 207 # For a normal installation, it should work without 'cwd' | 203 # For a normal installation, it should work without 'cwd' |
| 208 # argument. For test runs in the build directory, see #7774. | 204 # argument. For test runs in the build directory, see #7774. |
| 209 p = subprocess.Popen(["somethingyoudonthave", "-c", | 205 p = subprocess.Popen(["somethingyoudonthave", "-c", |
| 210 "import sys; sys.exit(47)"], | 206 "import sys; sys.exit(47)"], |
| 211 executable=sys.executable) | 207 executable=sys.executable) |
| 212 p.wait() | 208 p.wait() |
| 213 self.assertEqual(p.returncode, 47) | 209 self.assertEqual(p.returncode, 47) |
| (...skipping 1681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1895 HelperFunctionTests, | 1891 HelperFunctionTests, |
| 1896 CommandsWithSpaces, | 1892 CommandsWithSpaces, |
| 1897 ContextManagerTests, | 1893 ContextManagerTests, |
| 1898 ) | 1894 ) |
| 1899 | 1895 |
| 1900 support.run_unittest(*unit_tests) | 1896 support.run_unittest(*unit_tests) |
| 1901 support.reap_children() | 1897 support.reap_children() |
| 1902 | 1898 |
| 1903 if __name__ == "__main__": | 1899 if __name__ == "__main__": |
| 1904 unittest.main() | 1900 unittest.main() |
| OLD | NEW |