mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Issue #28732: Raise ValueError when os.spawn*() is passed an empty tuple of arguments
This commit is contained in:
parent
c3630612ab
commit
859fd7bd7a
2 changed files with 31 additions and 0 deletions
|
@ -2321,6 +2321,27 @@ class SpawnTests(unittest.TestCase):
|
|||
exitcode = os.spawnve(os.P_WAIT, args[0], args, self.env)
|
||||
self.assertEqual(exitcode, self.exitcode)
|
||||
|
||||
@requires_os_func('spawnl')
|
||||
def test_spawnl_noargs(self):
|
||||
args = self.create_args()
|
||||
self.assertRaises(ValueError, os.spawnl, os.P_NOWAIT, args[0])
|
||||
|
||||
@requires_os_func('spawnle')
|
||||
def test_spawnl_noargs(self):
|
||||
args = self.create_args()
|
||||
self.assertRaises(ValueError, os.spawnle, os.P_NOWAIT, args[0], {})
|
||||
|
||||
@requires_os_func('spawnv')
|
||||
def test_spawnv_noargs(self):
|
||||
args = self.create_args()
|
||||
self.assertRaises(ValueError, os.spawnv, os.P_NOWAIT, args[0], ())
|
||||
self.assertRaises(ValueError, os.spawnv, os.P_NOWAIT, args[0], [])
|
||||
|
||||
@requires_os_func('spawnve')
|
||||
def test_spawnv_noargs(self):
|
||||
args = self.create_args()
|
||||
self.assertRaises(ValueError, os.spawnve, os.P_NOWAIT, args[0], (), {})
|
||||
self.assertRaises(ValueError, os.spawnve, os.P_NOWAIT, args[0], [], {})
|
||||
|
||||
# The introduction of this TestCase caused at least two different errors on
|
||||
# *nix buildbots. Temporarily skip this to let the buildbots move along.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue