From 46682339d6ce381add10d44d74fc05ebad88600b Mon Sep 17 00:00:00 2001 From: Catherine Lee Date: Thu, 18 Jan 2024 11:50:01 -0800 Subject: [PATCH] update --- testing/test_junitxml.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py index 3f88c21e2..5f38f4a8c 100644 --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -1653,6 +1653,24 @@ def test_escaped_skipreason_issue3533( snode.assert_attr(message="1 <> 2") +def test_bin_escaped_skipreason( + pytester: Pytester, run_and_parse: RunAndParse +) -> None: + pytester.makepyfile( + """ + import pytest + @pytest.mark.skip("\33[31;1red\33[0m") + def test_skip(): + pass + """ + ) + _, dom = run_and_parse() + node = dom.find_first_by_tag("testcase") + snode = node.find_first_by_tag("skipped") + assert "#x1B[31;1mred#x1B[0m" in snode.text + snode.assert_attr(message="#x1B[31;1mred#x1B[0m") + + def test_escaped_setup_teardown_error( pytester: Pytester, run_and_parse: RunAndParse ) -> None: