summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2016-11-20 02:53:19 (GMT)
committerSteve Dower <steve.dower@microsoft.com>2016-11-20 02:53:19 (GMT)
commit859fd7bd7af90ce9a7f3a3184f2fce83013e0a96 (patch)
tree96ffcf08c7c1ebf7b5f721da50c8d35c37771aff /Lib/test
parentc3630612ab4f53976d10db2e22855a5a853788da (diff)
downloadcpython-859fd7bd7af90ce9a7f3a3184f2fce83013e0a96.zip
cpython-859fd7bd7af90ce9a7f3a3184f2fce83013e0a96.tar.gz
cpython-859fd7bd7af90ce9a7f3a3184f2fce83013e0a96.tar.bz2
Issue #28732: Raise ValueError when os.spawn*() is passed an empty tuple of arguments
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_os.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index b3d0b1e..9194a8a 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -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.