Skip to content

Commit 4fcb100

Browse files
committed
Execute test commands always with shell
There is no need to handle tests on Windows and Unix differently here. Always using a shell allows for more flexibility when writing tests.
1 parent fb6e313 commit 4fcb100

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

tests/system_tests.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,17 @@
55
import inspect
66
import subprocess
77
import threading
8-
import shlex
98
import sys
109
import shutil
1110
import string
1211
import unittest
1312

1413

1514
if sys.platform == 'win32':
16-
#: invoke subprocess.Popen with shell=True on Windows
17-
_SUBPROCESS_SHELL = True
18-
19-
def _cmd_splitter(cmd):
20-
return cmd
21-
2215
def _process_output_post(output):
2316
return output.replace('\r\n', '\n')
2417

2518
else:
26-
#: invoke subprocess.Popen with shell=False on Unix
27-
_SUBPROCESS_SHELL = False
28-
29-
def _cmd_splitter(cmd):
30-
return shlex.split(cmd)
31-
3219
def _process_output_post(output):
3320
return output
3421

@@ -551,13 +538,13 @@ def test_run(self):
551538
)
552539

553540
proc = subprocess.Popen(
554-
_cmd_splitter(command),
541+
command,
555542
stdout=subprocess.PIPE,
556543
stderr=subprocess.PIPE,
557544
stdin=subprocess.PIPE if stdin is not None else None,
558545
env=self._get_env(),
559546
cwd=self.work_dir,
560-
shell=_SUBPROCESS_SHELL
547+
shell=True,
561548
)
562549

563550
# Setup a threading.Timer which will terminate the command if it takes

0 commit comments

Comments
 (0)