From 04d052e30612b45330ff2fe83595e372fa21f9bd Mon Sep 17 00:00:00 2001 From: Gleb Nikonorov Date: Thu, 2 Jul 2020 15:31:03 -0400 Subject: [PATCH] fix mypy issue by using typing Match instead of re.Match --- src/_pytest/junitxml.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/_pytest/junitxml.py b/src/_pytest/junitxml.py index 4df7535de..ee44d9556 100644 --- a/src/_pytest/junitxml.py +++ b/src/_pytest/junitxml.py @@ -16,6 +16,7 @@ import sys from datetime import datetime from typing import Dict from typing import List +from typing import Match from typing import Optional from typing import Tuple from typing import Union @@ -70,7 +71,7 @@ _py_ext_re = re.compile(r"\.py$") def bin_xml_escape(arg: str) -> py.xml.raw: - def repl(matchobj: "re.Match[str]") -> str: + def repl(matchobj: "Match[str]") -> str: i = ord(matchobj.group()) if i <= 0xFF: return "#x%02X" % i