From 2aa5436ee743bd16fe51d52f6e6c9d05fd0f00bb Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 9 Apr 2020 16:36:59 +0300 Subject: [PATCH] Remove Python 2 compat code in test_juintxml.py --- testing/test_junitxml.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py index 0d6adb3a0..a1f86b0b8 100644 --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -7,6 +7,7 @@ import py import xmlschema import pytest +from _pytest.junitxml import bin_xml_escape from _pytest.junitxml import LogXML from _pytest.pathlib import Path from _pytest.reports import BaseReport @@ -969,11 +970,6 @@ def test_invalid_xml_escape(): # the higher ones. # XXX Testing 0xD (\r) is tricky as it overwrites the just written # line in the output, so we skip it too. - global unichr - try: - unichr(65) - except NameError: - unichr = chr invalid = ( 0x00, 0x1, @@ -990,17 +986,15 @@ def test_invalid_xml_escape(): valid = (0x9, 0xA, 0x20) # 0xD, 0xD7FF, 0xE000, 0xFFFD, 0x10000, 0x10FFFF) - from _pytest.junitxml import bin_xml_escape - for i in invalid: - got = bin_xml_escape(unichr(i)).uniobj + got = bin_xml_escape(chr(i)).uniobj if i <= 0xFF: expected = "#x%02X" % i else: expected = "#x%04X" % i assert got == expected for i in valid: - assert chr(i) == bin_xml_escape(unichr(i)).uniobj + assert chr(i) == bin_xml_escape(chr(i)).uniobj def test_logxml_path_expansion(tmpdir, monkeypatch):