sphinx/tests/test_websupport.py

37 lines
1.0 KiB
Python
Raw Normal View History

# -*- coding: utf-8 -*-
"""
test_websupport
~~~~~~~~~~~~~~~
Test the Web Support Package
2017-12-31 10:06:58 -06:00
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
2018-02-19 07:39:14 -06:00
import pytest
from sphinx.websupport import WebSupport
try:
sqlalchemy_missing = False
import sqlalchemy # NOQA
except ImportError:
sqlalchemy_missing = True
2010-07-30 16:13:51 -05:00
@pytest.mark.skipif(sqlalchemy_missing, reason='needs sqlalchemy')
def test_build(request, rootdir, sphinx_test_tempdir):
2017-01-03 07:24:00 -06:00
settings = {
'srcdir': rootdir / 'test-basic',
2017-01-03 07:24:00 -06:00
# to use same directory for 'builddir' in each 'support' fixture, using
# 'sphinx_test_tempdir' (static) value instead of 'tempdir' fixture value.
2017-01-03 07:24:00 -06:00
# each test expect result of db value at previous test case.
'builddir': sphinx_test_tempdir / 'websupport'
2017-01-03 07:24:00 -06:00
}
marker = request.node.get_marker('support')
if marker:
settings.update(marker.kwargs)
2010-08-04 13:09:07 -05:00
2017-01-03 07:24:00 -06:00
support = WebSupport(**settings)
support.build()