Skip to content

Commit 5ef89c4

Browse files
committed
Fixed unit test error on combination of Python 2.7 and Windows
1 parent 3a3c867 commit 5ef89c4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ rerNews
1515
* Enhanced tab-completion of cmd2 command names to support case-insensitive completion
1616
* Added an example showing how to remove unused commands
1717
* Improved how transcript testing handles prompts with ANSI escape codes by stripping them
18+
* Greatly improved implementation for how command output gets piped to a shell command
1819

1920
0.7.5
2021
-----

tests/test_cmd2.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,10 @@ def test_pipe_to_shell_error(base_app, capsys):
589589

590590
expected_error = 'FileNotFoundError'
591591
if six.PY2:
592-
expected_error = 'OSError'
592+
if sys.platform.startswith('win'):
593+
expected_error = 'WindowsError'
594+
else:
595+
expected_error = 'OSError'
593596
assert err.startswith("EXCEPTION of type '{}' occurred with message:".format(expected_error))
594597

595598

0 commit comments

Comments
 (0)