Skip to content

Commit 8fd8c56

Browse files
committed
Fixing Windows unit test that hangs on AppVeyor due to a KeyboardInterrupt
1 parent c448860 commit 8fd8c56

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ install:
3232
- "python -m pip install --upgrade pip wheel setuptools tox"
3333

3434
test_script:
35-
- "echo y | tox -e %TOXENV%"
35+
- "tox -e %TOXENV%"

tests/test_utils.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,21 @@ def test_stdsim_line_buffering(base_app):
226226
@pytest.fixture
227227
def pr_none():
228228
import subprocess
229-
command = 'ls'
229+
230+
# Put the new process into a separate group so signals sent to it won't interfere with this process
230231
if sys.platform.startswith('win'):
231232
command = 'dir'
232-
proc = subprocess.Popen([command], shell=True)
233+
creationflags = subprocess.CREATE_NEW_PROCESS_GROUP
234+
start_new_session = False
235+
else:
236+
command = 'ls'
237+
creationflags = 0
238+
start_new_session = True
239+
240+
proc = subprocess.Popen([command],
241+
creationflags=creationflags,
242+
start_new_session=start_new_session,
243+
shell=True)
233244
pr = cu.ProcReader(proc, None, None)
234245
return pr
235246

0 commit comments

Comments
 (0)