Skip to content

Commit 6c54756

Browse files
committed
Add test case for #595.
This new test proves that reports do not capture stdout by default when skipped.
1 parent a6084ed commit 6c54756

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

testing/test_junitxml.py

+12
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,18 @@ def test_skip():
249249
snode = tnode.find_first_by_tag("skipped")
250250
snode.assert_attr(type="pytest.skip", message="hello25", )
251251

252+
def test_mark_skip_doesnt_capture_output(self, testdir):
253+
testdir.makepyfile("""
254+
import pytest
255+
@pytest.mark.skip(reason="foo")
256+
def test_skip():
257+
print("bar!")
258+
""")
259+
result, dom = runandparse(testdir)
260+
assert result.ret == 0
261+
node_xml = dom.find_first_by_tag("testsuite").toxml()
262+
assert "bar!" not in node_xml
263+
252264
def test_classname_instance(self, testdir):
253265
testdir.makepyfile("""
254266
class TestClass:

0 commit comments

Comments
 (0)