Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.

Commit 59e21b1

Browse files
Smithabosd
authored andcommitted
New test for matplotlib importerror
1 parent 51e7c2a commit 59e21b1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_cli.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import os
2+
import sys
23

4+
from unittest import mock
35
import pytest
46
from click.testing import CliRunner
57

@@ -298,3 +300,11 @@ def test_cli_lattice_plot_type():
298300
],
299301
)
300302
assert result.exit_code != 0, f"Output: {result.output}"
303+
304+
305+
def test_import_error():
306+
with mock.patch.dict(sys.modules, {"matplotlib": None}):
307+
try:
308+
from camelot.cli import cli
309+
except ImportError:
310+
assert cli._HAS_MPL is False

0 commit comments

Comments
 (0)