Skip to content

Commit c56ad0f

Browse files
author
Todd Leonhardt
committed
Fixes a bug which caused transcript failures to display twice
1 parent af37a34 commit c56ad0f

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

cmd2.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,8 +1895,7 @@ class TestMyAppCase(Cmd2TestCase):
18951895
sys.argv = [sys.argv[0]] # the --test argument upsets unittest.main()
18961896
testcase = TestMyAppCase()
18971897
runner = unittest.TextTestRunner()
1898-
result = runner.run(testcase)
1899-
result.printErrors()
1898+
runner.run(testcase)
19001899

19011900
def _run_commands_at_invocation(self, callargs):
19021901
"""Runs commands provided as arguments on the command line when the application is started.

tests/test_transcript.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def test_transcript_from_cmdloop(request, capsys):
270270

271271
# Check for the unittest "OK" condition for the 1 test which ran
272272
expected_start = ".\n----------------------------------------------------------------------\nRan 1 test in"
273-
expected_end = "s\n\nOK\n\n"
273+
expected_end = "s\n\nOK\n"
274274
out, err = capsys.readouterr()
275275
if six.PY3:
276276
assert err.startswith(expected_start)
@@ -296,7 +296,7 @@ def test_multiline_command_transcript_with_comments_at_beginning(request, capsys
296296

297297
# Check for the unittest "OK" condition for the 1 test which ran
298298
expected_start = ".\n----------------------------------------------------------------------\nRan 1 test in"
299-
expected_end = "s\n\nOK\n\n"
299+
expected_end = "s\n\nOK\n"
300300
out, err = capsys.readouterr()
301301
if six.PY3:
302302
assert err.startswith(expected_start)
@@ -329,7 +329,7 @@ def test_regex_transcript(request, capsys):
329329

330330
# Check for the unittest "OK" condition for the 1 test which ran
331331
expected_start = ".\n----------------------------------------------------------------------\nRan 1 test in"
332-
expected_end = "s\n\nOK\n\n"
332+
expected_end = "s\n\nOK\n"
333333
out, err = capsys.readouterr()
334334
if six.PY3:
335335
assert err.startswith(expected_start)

0 commit comments

Comments
 (0)