Skip to content

Commit 1e2da78

Browse files
deal with 'unused import' ruff errors
although it might be smarter to use importlib.util.find_spec, as ruff suggests
1 parent 9d452c0 commit 1e2da78

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

mypy/test/testcheck.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from mypy.test.update_data import update_testcase_output
2626

2727
try:
28-
import lxml
28+
pass # import lxml #try just passing for now...
2929
except ImportError:
3030
lxml_import_failure = True
3131

mypy/test/testcmdline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
)
2121

2222
try:
23-
import lxml
23+
pass # import lxml #try just passing for now...
2424
except ImportError:
2525
lxml_import_failure = True
2626

mypy/test/testreports.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from mypy.test.helpers import Suite, assert_equal
99

1010
try:
11-
import lxml
11+
import lxml.etree as etree
1212
except ImportError:
1313
lxml_import_failure = True
1414

@@ -23,8 +23,6 @@ def test_get_line_rate(self) -> None:
2323

2424
@pytest.mark.skipif(lxml_import_failure, reason="Cannot import lxml. Is it installed?")
2525
def test_as_xml(self) -> None:
26-
import lxml.etree as etree
27-
2826
cobertura_package = CoberturaPackage("foobar")
2927
cobertura_package.covered_lines = 21
3028
cobertura_package.total_lines = 42

0 commit comments

Comments
 (0)