Skip to content

Commit 93781f7

Browse files
committed
Remove unused reference to pygments in test
1 parent efa2eb2 commit 93781f7

File tree

2 files changed

+2
-23
lines changed

2 files changed

+2
-23
lines changed

distutils/tests/test_check.py

+2-18
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88

99
import pytest
1010

11-
try:
12-
import pygments
13-
except ImportError:
14-
pygments = None
15-
16-
1711
HERE = os.path.dirname(__file__)
1812

1913

@@ -103,7 +97,6 @@ def test_check_author_maintainer(self):
10397
assert cmd._warnings == 0
10498

10599
def test_check_document(self):
106-
pytest.importorskip('docutils')
107100
pkg_info, dist = self.create_dist()
108101
cmd = check(dist)
109102

@@ -118,7 +111,6 @@ def test_check_document(self):
118111
assert len(msgs) == 0
119112

120113
def test_check_restructuredtext(self):
121-
pytest.importorskip('docutils')
122114
# let's see if it detects broken rest in long_description
123115
broken_rest = 'title\n===\n\ntest'
124116
pkg_info, dist = self.create_dist(long_description=broken_rest)
@@ -149,9 +141,7 @@ def test_check_restructuredtext(self):
149141
assert cmd._warnings == 0
150142

151143
def test_check_restructuredtext_with_syntax_highlight(self):
152-
pytest.importorskip('docutils')
153144
# Don't fail if there is a `code` or `code-block` directive
154-
155145
example_rst_docs = [
156146
textwrap.dedent(
157147
"""\
@@ -179,15 +169,9 @@ def foo():
179169
pkg_info, dist = self.create_dist(long_description=rest_with_code)
180170
cmd = check(dist)
181171
cmd.check_restructuredtext()
172+
assert cmd._warnings == 0
182173
msgs = cmd._check_rst_data(rest_with_code)
183-
if pygments is not None:
184-
assert len(msgs) == 0
185-
else:
186-
assert len(msgs) == 1
187-
assert (
188-
str(msgs[0][1])
189-
== 'Cannot analyze code. Pygments package not found.'
190-
)
174+
assert len(msgs) == 0
191175

192176
def test_check_all(self):
193177
with pytest.raises(DistutilsSetupError):

mypy.ini

-5
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ disable_error_code =
3131
misc,
3232
has-type,
3333

34-
# Is only imported in a test and doesn't seem relevant.
35-
# TODO: Should we add types-pygments or remove from the test?
36-
[mypy-pygments.*]
37-
ignore_missing_imports = True
38-
3934
# stdlib's test module is not typed on typeshed
4035
[mypy-test.*]
4136
ignore_missing_imports = True

0 commit comments

Comments
 (0)