Skip to content

Commit cbd088b

Browse files
committed
tests: skip testreports with missing lxml
Ref: #6912 (comment)
1 parent d5bc385 commit cbd088b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mypy/test/testreports.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
from mypy.test.helpers import Suite, assert_equal
55
from mypy.report import CoberturaPackage, get_line_rate
66

7-
import lxml.etree as etree # type: ignore
7+
try:
8+
import lxml.etree as etree # type: ignore
9+
except ImportError as exc:
10+
import pytest # type: ignore # no pytest in typeshed
11+
12+
pytestmark = pytest.mark.skip("no lxml: {}".format(exc))
813

914

1015
class CoberturaReportSuite(Suite):

0 commit comments

Comments
 (0)