tests: Stop explicitly checking for modules

This will have already been handled by setuptools. If the user isn't
using this then they've dug their own grave.

Signed-off-by: Stephen Finucane <stephen@that.guru>
This commit is contained in:
Stephen Finucane 2017-12-22 18:50:47 +00:00
parent 4fd217ce88
commit 9348c4bea1

View File

@ -27,19 +27,6 @@ warnings.filterwarnings('ignore', category=ImportWarning, module='pkgutil')
warnings.filterwarnings('ignore', category=ImportWarning, module='pytest_cov')
warnings.filterwarnings('ignore', category=PendingDeprecationWarning, module=r'_pytest\..*')
# check dependencies before testing
print('Checking dependencies...')
for modname in ('pytest', 'mock', 'six', 'docutils', 'jinja2', 'pygments',
'snowballstemmer', 'babel', 'html5lib'):
try:
__import__(modname)
except ImportError as err:
if modname == 'mock' and sys.version_info[0] == 3:
continue
traceback.print_exc()
print('The %r package is needed to run the Sphinx test suite.' % modname)
sys.exit(1)
# find a temp dir for testing and clean it up now
os.environ['SPHINX_TEST_TEMPDIR'] = \
os.path.abspath(os.path.join(testroot, 'build')) \