From 6c5475660afadd66a8ab46c415e45e2839d3d581 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Sat, 26 Nov 2016 18:47:26 +0100 Subject: [PATCH] Add test case for #595. This new test proves that reports do not capture stdout by default when skipped. --- testing/test_junitxml.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py index 85e49e451..443b8111b 100644 --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -249,6 +249,18 @@ class TestPython: snode = tnode.find_first_by_tag("skipped") snode.assert_attr(type="pytest.skip", message="hello25", ) + def test_mark_skip_doesnt_capture_output(self, testdir): + testdir.makepyfile(""" + import pytest + @pytest.mark.skip(reason="foo") + def test_skip(): + print("bar!") + """) + result, dom = runandparse(testdir) + assert result.ret == 0 + node_xml = dom.find_first_by_tag("testsuite").toxml() + assert "bar!" not in node_xml + def test_classname_instance(self, testdir): testdir.makepyfile(""" class TestClass: