Skip to content

Commit 1e97ea6

Browse files
authored
Merge pull request #2091 from lwm/move-595-along
Add test case for #595.
2 parents 58f28bf + 6c54756 commit 1e97ea6

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)