summaryrefslogtreecommitdiff
path: root/testing/test_capture.py
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2019-03-23 23:14:39 +0100
committerDaniel Hahler <git@thequod.de>2019-03-23 23:17:07 +0100
commitd0f3f26fffccd16e349518f9a5f83dcce4e37d12 (patch)
tree5eb272819329dd082cca4eed58e7d90211254f56 /testing/test_capture.py
parentb3319a6074636eb651063bff7eec69ec289f1df5 (diff)
downloadpytest-d0f3f26fffccd16e349518f9a5f83dcce4e37d12.tar.gz
test_collect_capturing: cover captured stderr
Diffstat (limited to 'testing/test_capture.py')
-rw-r--r--testing/test_capture.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/testing/test_capture.py b/testing/test_capture.py
index 5ed806fa4..14eae7efa 100644
--- a/testing/test_capture.py
+++ b/testing/test_capture.py
@@ -134,12 +134,22 @@ def test_capturing_bytes_in_utf8_encoding(testdir, method):
def test_collect_capturing(testdir):
p = testdir.makepyfile(
"""
+ import sys
+
print("collect %s failure" % 13)
+ sys.stderr.write("collect %s_stderr failure" % 13)
import xyz42123
"""
)
result = testdir.runpytest(p)
- result.stdout.fnmatch_lines(["*Captured stdout*", "*collect 13 failure*"])
+ result.stdout.fnmatch_lines(
+ [
+ "*Captured stdout*",
+ "collect 13 failure",
+ "*Captured stderr*",
+ "collect 13_stderr failure",
+ ]
+ )
class TestPerTestCapturing(object):