summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2017-02-05 15:31:07 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2017-02-05 15:31:07 -0500
commit059e6b838f2b88c56b04aee2ba21f971e76760d1 (patch)
tree63103e321d48b5df9272ac229c9979756282871a
parente08e21880a666bb9beca31c9e96c319d35f8c8c0 (diff)
downloadcmd2-git-059e6b838f2b88c56b04aee2ba21f971e76760d1.tar.gz
Fixed unit test skip condition.
The input redirection test which only fails on TravisCI Linux containers will now only be skipped if the user name is travis AND the OS is Linux (but will now be validly skipped for both Python 2 and 3).
-rw-r--r--tests/test_cmd2.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 3f28e791..6330c8a7 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -5,6 +5,7 @@ Cmd2 unit/functional testing
Copyright 2016 Federico Ceratto <federico.ceratto@gmail.com>
Released under MIT license, see LICENSE file
"""
+import getpass
import os
import sys
@@ -287,7 +288,7 @@ def test_output_redirection(base_app):
os.remove(filename)
-@pytest.mark.skipif(sys.platform == 'linux',
+@pytest.mark.skipif(getpass.getuser() == 'travis' and sys.platform.startswith('linux'),
reason="Unit test passes on Ubuntu 16.04 and Debian 8.7, but fails on TravisCI Linux containers")
def test_input_redirection(base_app, request):
test_dir = os.path.dirname(request.module.__file__)