sphinx/tests/test_websupport.py

37 lines
989 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
"""
test_websupport
~~~~~~~~~~~~~~~
Test the Web Support Package
2017-03-22 06:21:12 -05:00
:copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from sphinx.websupport import WebSupport
try:
sqlalchemy_missing = False
except ImportError:
sqlalchemy_missing = True
2017-01-03 07:24:00 -06:00
import pytest
from util import rootdir, tempdir
2010-07-30 16:13:51 -05:00
@pytest.mark.skipif(sqlalchemy_missing, reason='needs sqlalchemy')
def test_build(request):
2017-01-03 07:24:00 -06:00
settings = {
'srcdir': rootdir / 'roots' / 'test-basic',
2017-01-03 07:24:00 -06:00
# to use same directory for 'builddir' in each 'support' fixture, using
# 'tempdir' (static) value instead of 'tempdir' fixture value.
# each test expect result of db value at previous test case.
'builddir': tempdir / 'websupport'
}
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()