diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-11-12 02:07:15 -0500 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-11-12 02:07:15 -0500 |
commit | 8fd8c56bdabafd58fbe0af284ced4765952557bc (patch) | |
tree | 3253bcdbaec1037b9eedd062f4d4f21e0b9a76ea /tests | |
parent | c44886011fbdbad5010a2e1a1afabf184484dc0d (diff) | |
download | cmd2-git-8fd8c56bdabafd58fbe0af284ced4765952557bc.tar.gz |
Fixing Windows unit test that hangs on AppVeyor due to a KeyboardInterrupt
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_utils.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py index 1890a753..042b389c 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -226,10 +226,21 @@ def test_stdsim_line_buffering(base_app): @pytest.fixture def pr_none(): import subprocess - command = 'ls' + + # Put the new process into a separate group so signals sent to it won't interfere with this process if sys.platform.startswith('win'): command = 'dir' - proc = subprocess.Popen([command], shell=True) + creationflags = subprocess.CREATE_NEW_PROCESS_GROUP + start_new_session = False + else: + command = 'ls' + creationflags = 0 + start_new_session = True + + proc = subprocess.Popen([command], + creationflags=creationflags, + start_new_session=start_new_session, + shell=True) pr = cu.ProcReader(proc, None, None) return pr |