Skip to content

Commit 02d2d27

Browse files
committed
test_python_cmdline: skip --html-report tests without lxml
1 parent bc52c33 commit 02d2d27

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mypy/test/testcmdline.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from mypy.test.data import fix_cobertura_filename
1616
from mypy.test.data import DataDrivenTestCase, DataSuite
1717
from mypy.test.helpers import assert_string_arrays_equal, normalize_error_messages
18+
import pytest
1819
import mypy.version
1920

2021
# Path to Python 3 interpreter
@@ -45,6 +46,8 @@ def test_python_cmdline(testcase: DataDrivenTestCase, step: int) -> None:
4546
for s in testcase.input:
4647
file.write('{}\n'.format(s))
4748
args = parse_args(testcase.input[0])
49+
if "--html-report" in args:
50+
pytest.importorskip('lxml')
4851
args.append('--show-traceback')
4952
args.append('--no-site-packages')
5053
# Type check the program.

0 commit comments

Comments
 (0)