Skip to content

Commit 283a804

Browse files
committed
Mark failing tests.
1 parent 7366a41 commit 283a804

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

Lib/test/test_subprocess.py

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,7 @@ def is_env_var_to_ignore(n):
811811
if not is_env_var_to_ignore(k)]
812812
self.assertEqual(child_env_names, [])
813813

814+
@unittest.skipIf(sys.platform == "win32", "TODO: RUSTPYTHON, null byte is not checked")
814815
def test_invalid_cmd(self):
815816
# null character in the command name
816817
cmd = sys.executable + '\0'
@@ -956,6 +957,7 @@ def test_communicate_returns(self):
956957
self.assertEqual(stdout, None)
957958
self.assertEqual(stderr, None)
958959

960+
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
959961
def test_communicate_pipe_buf(self):
960962
# communicate() with writes larger than pipe_buf
961963
# This test will probably deadlock rather than fail, if
@@ -995,6 +997,8 @@ def test_writes_before_communicate(self):
995997
self.assertEqual(stdout, b"bananasplit")
996998
self.assertEqual(stderr, b"")
997999

1000+
# TODO: RUSTPYTHON
1001+
@unittest.expectedFailure
9981002
def test_universal_newlines_and_text(self):
9991003
args = [
10001004
sys.executable, "-c",
@@ -1034,6 +1038,7 @@ def test_universal_newlines_and_text(self):
10341038
self.assertEqual(p.stdout.read(),
10351039
"line4\nline5\nline6\nline7\nline8")
10361040

1041+
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
10371042
def test_universal_newlines_communicate(self):
10381043
# universal newlines through communicate()
10391044
p = subprocess.Popen([sys.executable, "-c",
@@ -1085,6 +1090,7 @@ def test_universal_newlines_communicate_input_none(self):
10851090
p.communicate()
10861091
self.assertEqual(p.returncode, 0)
10871092

1093+
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
10881094
def test_universal_newlines_communicate_stdin_stdout_stderr(self):
10891095
# universal newlines through communicate(), with stdin, stdout, stderr
10901096
p = subprocess.Popen([sys.executable, "-c",
@@ -1113,6 +1119,8 @@ def test_universal_newlines_communicate_stdin_stdout_stderr(self):
11131119
# to stderr at exit of subprocess.
11141120
self.assertTrue(stderr.startswith("eline2\neline6\neline7\n"))
11151121

1122+
# TODO: RUSTPYTHON
1123+
@unittest.expectedFailure
11161124
def test_universal_newlines_communicate_encodings(self):
11171125
# Check that universal newlines mode works for various encodings,
11181126
# in particular for encodings in the UTF-16 and UTF-32 families.
@@ -1135,6 +1143,8 @@ def test_universal_newlines_communicate_encodings(self):
11351143
stdout, stderr = popen.communicate(input='')
11361144
self.assertEqual(stdout, '1\n2\n3\n4')
11371145

1146+
# TODO: RUSTPYTHON
1147+
@unittest.expectedFailure
11381148
def test_communicate_errors(self):
11391149
for errors, expected in [
11401150
('ignore', ''),
@@ -1274,12 +1284,15 @@ def _test_bufsize_equal_one(self, line, expected, universal_newlines):
12741284
self.assertEqual(p.returncode, 0)
12751285
self.assertEqual(read_line, expected)
12761286

1287+
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
12771288
def test_bufsize_equal_one_text_mode(self):
12781289
# line is flushed in text mode with bufsize=1.
12791290
# we should get the full line in return
12801291
line = "line\n"
12811292
self._test_bufsize_equal_one(line, line, universal_newlines=True)
12821293

1294+
# TODO: RUSTPYTHON
1295+
@unittest.expectedFailure
12831296
def test_bufsize_equal_one_binary_mode(self):
12841297
# line is not flushed in binary mode with bufsize=1.
12851298
# we should get empty response
@@ -1452,6 +1465,7 @@ def test_handles_closed_on_exception(self):
14521465
self.assertFalse(os.path.exists(ofname))
14531466
self.assertFalse(os.path.exists(efname))
14541467

1468+
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
14551469
def test_communicate_epipe(self):
14561470
# Issue 10963: communicate() should hide EPIPE
14571471
p = subprocess.Popen(ZERO_RETURN_CMD,
@@ -1482,6 +1496,7 @@ def test_repr(self):
14821496
p.returncode = code
14831497
self.assertEqual(repr(p), sx)
14841498

1499+
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
14851500
def test_communicate_epipe_only_stdin(self):
14861501
# Issue 10963: communicate() should hide EPIPE
14871502
p = subprocess.Popen(ZERO_RETURN_CMD,
@@ -1490,6 +1505,8 @@ def test_communicate_epipe_only_stdin(self):
14901505
p.wait()
14911506
p.communicate(b"x" * 2**20)
14921507

1508+
# TODO: RUSTPYTHON
1509+
@unittest.expectedFailure
14931510
@unittest.skipUnless(hasattr(signal, 'SIGUSR1'),
14941511
"Requires signal.SIGUSR1")
14951512
@unittest.skipUnless(hasattr(os, 'kill'),
@@ -1539,6 +1556,8 @@ def test_file_not_found_includes_filename(self):
15391556
subprocess.call(['/opt/nonexistent_binary', 'with', 'some', 'args'])
15401557
self.assertEqual(c.exception.filename, '/opt/nonexistent_binary')
15411558

1559+
# TODO: RUSTPYTHON
1560+
@unittest.expectedFailure
15421561
@unittest.skipIf(mswindows, "behavior currently not supported on Windows")
15431562
def test_file_not_found_with_bad_cwd(self):
15441563
with self.assertRaises(FileNotFoundError) as c:
@@ -1739,6 +1758,8 @@ def test_run_with_shell_timeout_and_capture_output(self):
17391758
msg="TimeoutExpired was delayed! Bad traceback:\n```\n"
17401759
f"{stacks}```")
17411760

1761+
# TODO: RUSTPYTHON
1762+
@unittest.expectedFailure
17421763
def test_encoding_warning(self):
17431764
code = textwrap.dedent("""\
17441765
from subprocess import *
@@ -1785,6 +1806,8 @@ def _get_chdir_exception(self):
17851806
self._nonexistent_dir)
17861807
return desired_exception
17871808

1809+
# TODO: RUSTPYTHON
1810+
@unittest.expectedFailure
17881811
def test_exception_cwd(self):
17891812
"""Test error in the child raised in the parent for a bad cwd."""
17901813
desired_exception = self._get_chdir_exception()
@@ -1800,6 +1823,8 @@ def test_exception_cwd(self):
18001823
else:
18011824
self.fail("Expected OSError: %s" % desired_exception)
18021825

1826+
# TODO: RUSTPYTHON
1827+
@unittest.expectedFailure
18031828
def test_exception_bad_executable(self):
18041829
"""Test error in the child raised in the parent for a bad executable."""
18051830
desired_exception = self._get_chdir_exception()
@@ -1815,6 +1840,8 @@ def test_exception_bad_executable(self):
18151840
else:
18161841
self.fail("Expected OSError: %s" % desired_exception)
18171842

1843+
# TODO: RUSTPYTHON
1844+
@unittest.expectedFailure
18181845
def test_exception_bad_args_0(self):
18191846
"""Test error in the child raised in the parent for a bad args[0]."""
18201847
desired_exception = self._get_chdir_exception()
@@ -1879,6 +1906,8 @@ def bad_error(*args):
18791906

18801907
self.assertIn(repr(error_data), str(e.exception))
18811908

1909+
# TODO: RUSTPYTHON
1910+
@unittest.expectedFailure
18821911
@unittest.skipIf(not os.path.exists('/proc/self/status'),
18831912
"need /proc/self/status")
18841913
def test_restore_signals(self):
@@ -1919,6 +1948,8 @@ def test_start_new_session(self):
19191948
child_sid = int(output)
19201949
self.assertNotEqual(parent_sid, child_sid)
19211950

1951+
# TODO: RUSTPYTHON
1952+
@unittest.expectedFailure
19221953
@unittest.skipUnless(hasattr(os, 'setpgid') and hasattr(os, 'getpgid'),
19231954
'no setpgid or getpgid on platform')
19241955
def test_process_group_0(self):
@@ -1937,6 +1968,8 @@ def test_process_group_0(self):
19371968
child_pgid = int(output)
19381969
self.assertNotEqual(parent_pgid, child_pgid)
19391970

1971+
# TODO: RUSTPYTHON
1972+
@unittest.expectedFailure
19401973
@unittest.skipUnless(hasattr(os, 'setreuid'), 'no setreuid on platform')
19411974
def test_user(self):
19421975
# For code coverage of the user parameter. We don't care if we get an
@@ -1994,6 +2027,8 @@ def test_user_error(self):
19942027
with self.assertRaises(ValueError):
19952028
subprocess.check_call(ZERO_RETURN_CMD, user=65535)
19962029

2030+
# TODO: RUSTPYTHON, observed gids do not match expected gids
2031+
@unittest.expectedFailure
19972032
@unittest.skipUnless(hasattr(os, 'setregid'), 'no setregid() on platform')
19982033
def test_group(self):
19992034
gid = os.getegid()
@@ -2041,6 +2076,8 @@ def test_group_error(self):
20412076
with self.assertRaises(ValueError):
20422077
subprocess.check_call(ZERO_RETURN_CMD, group=65535)
20432078

2079+
# TODO: RUSTPYTHON, observed gids do not match expected gids
2080+
@unittest.expectedFailure
20442081
@unittest.skipUnless(hasattr(os, 'setgroups'), 'no setgroups() on platform')
20452082
def test_extra_groups(self):
20462083
gid = os.getegid()
@@ -2095,6 +2132,8 @@ def test_extra_groups_error(self):
20952132
with self.assertRaises(ValueError):
20962133
subprocess.check_call(ZERO_RETURN_CMD, extra_groups=[])
20972134

2135+
# TODO: RUSTPYTHON
2136+
@unittest.expectedFailure
20982137
@unittest.skipIf(mswindows or not hasattr(os, 'umask'),
20992138
'POSIX umask() is not available.')
21002139
def test_umask(self):
@@ -2146,6 +2185,8 @@ def test_CalledProcessError_str_non_zero(self):
21462185
error_string = str(err)
21472186
self.assertIn("non-zero exit status 2.", error_string)
21482187

2188+
# TODO: RUSTPYTHON
2189+
@unittest.expectedFailure
21492190
def test_preexec(self):
21502191
# DISCLAIMER: Setting environment variables is *not* a good use
21512192
# of a preexec_fn. This is merely a test.
@@ -2157,6 +2198,8 @@ def test_preexec(self):
21572198
with p:
21582199
self.assertEqual(p.stdout.read(), b"apple")
21592200

2201+
# TODO: RUSTPYTHON
2202+
@unittest.expectedFailure
21602203
def test_preexec_exception(self):
21612204
def raise_it():
21622205
raise ValueError("What if two swallows carried a coconut?")
@@ -2198,6 +2241,8 @@ def _execute_child(self, *args, **kwargs):
21982241
for fd in devzero_fds:
21992242
os.close(fd)
22002243

2244+
# TODO: RUSTPYTHON
2245+
@unittest.expectedFailure
22012246
@unittest.skipIf(not os.path.exists("/dev/zero"), "/dev/zero required.")
22022247
def test_preexec_errpipe_does_not_double_close_pipes(self):
22032248
"""Issue16140: Don't double close pipes on preexec error."""
@@ -2212,6 +2257,8 @@ def raise_it():
22122257
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
22132258
stderr=subprocess.PIPE, preexec_fn=raise_it)
22142259

2260+
# TODO: RUSTPYTHON
2261+
@unittest.expectedFailure
22152262
def test_preexec_gc_module_failure(self):
22162263
# This tests the code that disables garbage collection if the child
22172264
# process will execute any Python.
@@ -2233,6 +2280,8 @@ def test_preexec_gc_module_failure(self):
22332280
if not enabled:
22342281
gc.disable()
22352282

2283+
# TODO: RUSTPYTHON
2284+
@unittest.expectedFailure
22362285
@unittest.skipIf(
22372286
sys.platform == 'darwin', 'setrlimit() seems to fail on OS X')
22382287
def test_preexec_fork_failure(self):
@@ -2643,6 +2692,8 @@ def test_swap_std_fds_with_one_closed(self):
26432692
for to_fds in itertools.permutations(range(3), 2):
26442693
self._check_swap_std_fds_with_one_closed(from_fds, to_fds)
26452694

2695+
# TODO: RUSTPYTHON
2696+
@unittest.expectedFailure
26462697
def test_surrogates_error_message(self):
26472698
def prepare():
26482699
raise ValueError("surrogate:\uDCff")
@@ -2662,6 +2713,8 @@ def prepare():
26622713
else:
26632714
self.fail("Expected ValueError or subprocess.SubprocessError")
26642715

2716+
# TODO: RUSTPYTHON
2717+
@unittest.expectedFailure
26652718
def test_undecodable_env(self):
26662719
for key, value in (('test', 'abc\uDCFF'), ('test\uDCFF', '42')):
26672720
encoded_value = value.encode("ascii", "surrogateescape")
@@ -2782,6 +2835,7 @@ def kill_p2():
27822835
p1.stdout.close()
27832836
p2.stdout.close()
27842837

2838+
@unittest.skip("TODO: RUSTPYTHON, flaky test")
27852839
def test_close_fds(self):
27862840
fd_status = support.findfile("fd_status.py", subdir="subprocessdata")
27872841

@@ -2909,6 +2963,7 @@ def test_close_fds_when_max_fd_is_lowered(self):
29092963
msg="Some fds were left open.")
29102964

29112965

2966+
@unittest.skip("TODO: RUSTPYTHON, flaky test")
29122967
# Mac OS X Tiger (10.4) has a kernel bug: sometimes, the file
29132968
# descriptor of a pipe closed in the parent process is valid in the
29142969
# child process according to fstat(), but the mode of the file
@@ -3116,6 +3171,8 @@ def test_leak_fast_process_del_killed(self):
31163171
else:
31173172
self.assertNotIn(ident, [id(o) for o in subprocess._active])
31183173

3174+
# TODO: RUSTPYTHON
3175+
@unittest.expectedFailure
31193176
def test_close_fds_after_preexec(self):
31203177
fd_status = support.findfile("fd_status.py", subdir="subprocessdata")
31213178

@@ -3418,6 +3475,8 @@ def test_close_fds(self):
34183475
close_fds=True)
34193476
self.assertEqual(rc, 47)
34203477

3478+
# TODO: RUSTPYTHON
3479+
@unittest.expectedFailure
34213480
def test_close_fds_with_stdio(self):
34223481
import msvcrt
34233482

@@ -3500,6 +3559,8 @@ def test_shell_string(self):
35003559
with p:
35013560
self.assertIn(b"physalis", p.stdout.read())
35023561

3562+
# TODO: RUSTPYTHON
3563+
@unittest.expectedFailure
35033564
def test_shell_encodings(self):
35043565
# Run command through the shell (string)
35053566
for enc in ['ansi', 'oem']:
@@ -3646,6 +3707,7 @@ def popen_via_context_manager(*args, **kwargs):
36463707
raise KeyboardInterrupt # Test how __exit__ handles ^C.
36473708
self._test_keyboardinterrupt_no_kill(popen_via_context_manager)
36483709

3710+
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
36493711
def test_getoutput(self):
36503712
self.assertEqual(subprocess.getoutput('echo xyzzy'), 'xyzzy')
36513713
self.assertEqual(subprocess.getstatusoutput('echo xyzzy'),
@@ -3718,20 +3780,28 @@ def with_spaces(self, *args, **kwargs):
37183780
"2 [%r, 'ab cd']" % self.fname
37193781
)
37203782

3783+
# TODO: RUSTPYTHON
3784+
@unittest.expectedFailure
37213785
def test_shell_string_with_spaces(self):
37223786
# call() function with string argument with spaces on Windows
37233787
self.with_spaces('"%s" "%s" "%s"' % (sys.executable, self.fname,
37243788
"ab cd"), shell=1)
37253789

3790+
# TODO: RUSTPYTHON
3791+
@unittest.expectedFailure
37263792
def test_shell_sequence_with_spaces(self):
37273793
# call() function with sequence argument with spaces on Windows
37283794
self.with_spaces([sys.executable, self.fname, "ab cd"], shell=1)
37293795

3796+
# TODO: RUSTPYTHON
3797+
@unittest.expectedFailure
37303798
def test_noshell_string_with_spaces(self):
37313799
# call() function with string argument with spaces on Windows
37323800
self.with_spaces('"%s" "%s" "%s"' % (sys.executable, self.fname,
37333801
"ab cd"))
37343802

3803+
# TODO: RUSTPYTHON
3804+
@unittest.expectedFailure
37353805
def test_noshell_sequence_with_spaces(self):
37363806
# call() function with sequence argument with spaces on Windows
37373807
self.with_spaces([sys.executable, self.fname, "ab cd"])

0 commit comments

Comments
 (0)