-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Expand file tree
/
Copy path_markers.py
More file actions
49 lines (40 loc) · 1.39 KB
/
_markers.py
File metadata and controls
49 lines (40 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"""
pytest markers for the internal Matplotlib test suite.
"""
import logging
import shutil
import pytest
import matplotlib.testing
import matplotlib.testing.compare
from matplotlib import _get_executable_info, ExecutableNotFoundError
_log = logging.getLogger(__name__)
def _checkdep_usetex() -> bool:
if not shutil.which("tex"):
_log.warning("usetex mode requires TeX.")
return False
try:
_get_executable_info("dvipng")
except ExecutableNotFoundError:
_log.warning("usetex mode requires dvipng.")
return False
try:
_get_executable_info("gs")
except ExecutableNotFoundError:
_log.warning("usetex mode requires ghostscript.")
return False
return True
needs_ghostscript = pytest.mark.skipif(
"eps" not in matplotlib.testing.compare.converter,
reason="This test needs a ghostscript installation")
needs_pgf_lualatex = pytest.mark.skipif(
not matplotlib.testing._check_for_pgf('lualatex'),
reason='lualatex + pgf is required')
needs_pgf_pdflatex = pytest.mark.skipif(
not matplotlib.testing._check_for_pgf('pdflatex'),
reason='pdflatex + pgf is required')
needs_pgf_xelatex = pytest.mark.skipif(
not matplotlib.testing._check_for_pgf('xelatex'),
reason='xelatex + pgf is required')
needs_usetex = pytest.mark.skipif(
not _checkdep_usetex(),
reason="This test needs a TeX installation")