File tree Expand file tree Collapse file tree 4 files changed +15
-5
lines changed Expand file tree Collapse file tree 4 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 2626from mypy .version import __version__
2727
2828try :
29- from lxml import etree # type: ignore[import-untyped]
29+ from lxml import etree
3030
3131 LXML_INSTALLED = True
3232except ImportError :
Original file line number Diff line number Diff line change 77import sys
88import tempfile
99from pathlib import Path
10+ from types import ModuleType
11+ from typing import Optional
1012
1113from mypy import build
1214from mypy .errors import CompileError
2527)
2628from mypy .test .update_data import update_testcase_output
2729
30+ lxml : Optional [ModuleType ] #lxml is an optional dependency
2831try :
29- import lxml # type: ignore[import-untyped]
32+ import lxml
3033except ImportError :
3134 lxml = None
3235
Original file line number Diff line number Diff line change 1010import re
1111import subprocess
1212import sys
13+ from types import ModuleType
14+ from typing import Optional
1315
1416from mypy .test .config import PREFIX , test_temp_dir
1517from mypy .test .data import DataDrivenTestCase , DataSuite
1921 normalize_error_messages ,
2022)
2123
24+ lxml : Optional [ModuleType ] #lxml is an optional dependency
2225try :
23- import lxml # type: ignore[import-untyped]
26+ import lxml
2427except ImportError :
2528 lxml = None
2629
Original file line number Diff line number Diff line change 33from __future__ import annotations
44
55import textwrap
6+ from types import ModuleType
7+ from typing import Optional
8+
69
710from mypy .report import CoberturaPackage , get_line_rate
811from mypy .test .helpers import Suite , assert_equal
912
13+ lxml : Optional [ModuleType ] #lxml is an optional dependency
1014try :
11- import lxml # type: ignore[import-untyped]
15+ import lxml
1216except ImportError :
1317 lxml = None
1418
@@ -23,7 +27,7 @@ def test_get_line_rate(self) -> None:
2327
2428 @pytest .mark .skipif (lxml is None , reason = "Cannot import lxml. Is it installed?" )
2529 def test_as_xml (self ) -> None :
26- import lxml .etree as etree # type: ignore[import-untyped]
30+ import lxml .etree as etree
2731
2832 cobertura_package = CoberturaPackage ("foobar" )
2933 cobertura_package .covered_lines = 21
You can’t perform that action at this time.
0 commit comments