summaryrefslogtreecommitdiff
path: root/tests/test_utils.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-11-12 19:54:41 -0500
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-11-12 19:54:41 -0500
commit640d723f02dd791a66c76439703d622d758fa702 (patch)
tree2db9c7b152558604b6facc1cd44e3577f823e996 /tests/test_utils.py
parent2e8779fe5571a1bbebfd7782aa3e883a2c540a42 (diff)
downloadcmd2-git-640d723f02dd791a66c76439703d622d758fa702.tar.gz
Fixing unit tests that were causing problems on the test servers
Diffstat (limited to 'tests/test_utils.py')
-rw-r--r--tests/test_utils.py17
1 files changed, 4 insertions, 13 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 042b389c..312acdf0 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -227,24 +227,24 @@ def test_stdsim_line_buffering(base_app):
def pr_none():
import subprocess
+ # Start a long running process so we have time to run tests on it before it finishes
# 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'
+ command = 'timeout -t -1 /nobreak'
creationflags = subprocess.CREATE_NEW_PROCESS_GROUP
start_new_session = False
else:
- command = 'ls'
+ command = 'sleep 10'
creationflags = 0
start_new_session = True
- proc = subprocess.Popen([command],
+ proc = subprocess.Popen(command,
creationflags=creationflags,
start_new_session=start_new_session,
shell=True)
pr = cu.ProcReader(proc, None, None)
return pr
-@pytest.mark.skipif(sys.platform == 'linux', reason="Test doesn't work correctly on TravisCI")
def test_proc_reader_send_sigint(pr_none):
assert pr_none._proc.poll() is None
pr_none.send_sigint()
@@ -255,8 +255,6 @@ def test_proc_reader_send_sigint(pr_none):
else:
assert ret_code == -signal.SIGINT
-@pytest.mark.skipif(not sys.platform.startswith('win'),
- reason="Test doesn't work correctly on TravisCI and is unreliable on Azure DevOps macOS")
def test_proc_reader_terminate(pr_none):
assert pr_none._proc.poll() is None
pr_none.terminate()
@@ -267,13 +265,6 @@ def test_proc_reader_terminate(pr_none):
else:
assert ret_code == -signal.SIGTERM
-@pytest.mark.skipif(not sys.platform.startswith('win'),
- reason="Test doesn't work correctly on TravisCI and is unreliable on Azure DevOps macOS")
-def test_proc_reader_wait(pr_none):
- assert pr_none._proc.poll() is None
- pr_none.wait()
- assert pr_none._proc.poll() == 0
-
@pytest.fixture
def context_flag():