bpo-40055: distutils tests now disable docutils import by vstinner · Pull Request #19139 · python/cpython · GitHub
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Lib/distutils/tests/__init__.py
1 change: 1 addition & 0 deletions Lib/distutils/tests/test_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import unittest
from test.support import run_unittest

# bpo-40055: distutils.tests prevents docutils from being imported
from distutils.command.check import check, HAS_DOCUTILS
from distutils.tests import support
from distutils.errors import DistutilsSetupError
Expand Down
10 changes: 4 additions & 6 deletions Lib/distutils/tests/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@

from distutils.tests.test_config import BasePyPIRCCommandTestCase

try:
import docutils
except ImportError:
docutils = None
# bpo-40055: distutils.tests prevents docutils from being imported
from distutils.command.check import HAS_DOCUTILS

PYPIRC_NOPASSWORD = """\
[distutils]
Expand Down Expand Up @@ -204,7 +202,7 @@ def test_password_reset(self):
self.assertEqual(headers['Content-length'], '290')
self.assertIn(b'tarek', req.data)

@unittest.skipUnless(docutils is not None, 'needs docutils')
@unittest.skipUnless(HAS_DOCUTILS, 'needs docutils')
def test_strict(self):
# testing the script option
# when on, the register command stops if
Expand Down Expand Up @@ -270,7 +268,7 @@ def test_strict(self):
finally:
del register_module.input

@unittest.skipUnless(docutils is not None, 'needs docutils')
@unittest.skipUnless(HAS_DOCUTILS, 'needs docutils')
def test_register_invalid_long_description(self):
description = ':funkie:`str`' # mimic Sphinx-specific markup
metadata = {'url': 'xxx', 'author': 'xxx',
Expand Down