MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_args_string

Method test_args_string

Lib/test/test_subprocess.py:2487–2499  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2485 self.skipTest('RLIMIT_NPROC had no effect; probably superuser')
2486
2487 def test_args_string(self):
2488 # args is a string
2489 fd, fname = tempfile.mkstemp()
2490 # reopen in text mode
2491 with open(fd, "w", errors="surrogateescape") as fobj:
2492 fobj.write("#!%s\n" % support.unix_shell)
2493 fobj.write("exec '%s' -c 'import sys; sys.exit(47)'\n" %
2494 sys.executable)
2495 os.chmod(fname, 0o700)
2496 p = subprocess.Popen(fname)
2497 p.wait()
2498 os.remove(fname)
2499 self.assertEqual(p.returncode, 47)
2500
2501 def test_invalid_args(self):
2502 # invalid arguments should raise ValueError

Callers

nothing calls this directly

Calls 6

waitMethod · 0.95
openFunction · 0.50
writeMethod · 0.45
chmodMethod · 0.45
removeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected