From b417d7cb7992f668f67ed0cb5dd5c9aea74fe1e3 Mon Sep 17 00:00:00 2001 From: David Vierra Date: Tue, 8 Dec 2015 15:54:23 -1000 Subject: [PATCH] Add tests to test_terminal.py for -rp and -rP --- testing/test_terminal.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/testing/test_terminal.py b/testing/test_terminal.py index cf0554077..cc27a4e51 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -522,6 +522,31 @@ def test_fail_reporting_on_pass(testdir): result = testdir.runpytest('-rf') assert 'short test summary' not in result.stdout.str() +def test_pass_extra_reporting(testdir): + testdir.makepyfile("def test_this(): assert 1") + result = testdir.runpytest() + assert 'short test summary' not in result.stdout.str() + result = testdir.runpytest('-rp') + result.stdout.fnmatch_lines([ + "*test summary*", + "PASS*test_pass_extra_reporting*", + ]) + +def test_pass_reporting_on_fail(testdir): + testdir.makepyfile("def test_this(): assert 0") + result = testdir.runpytest('-rp') + assert 'short test summary' not in result.stdout.str() + +def test_pass_output_reporting(testdir): + testdir.makepyfile(""" + def test_pass_output(): + print("Four score and seven years ago...") + """) + result = testdir.runpytest('-rP') + result.stdout.fnmatch_lines([ + "Four score and seven years ago...", + ]) + def test_color_yes(testdir): testdir.makepyfile("def test_this(): assert 1") result = testdir.runpytest('--color=yes')