mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
refs #3458: add sphinx.testing that are moved from /tests directory.
This commit is contained in:
@@ -18,19 +18,11 @@ import sphinx
|
||||
import pytest
|
||||
|
||||
from sphinx.util.osutil import cd
|
||||
from util import rootdir, tempdir
|
||||
from textwrap import dedent
|
||||
|
||||
root = tempdir / 'test-setup'
|
||||
|
||||
|
||||
def setup_module():
|
||||
if not root.exists():
|
||||
(rootdir / 'roots' / 'test-setup').copytree(root)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def setup_command(request, tempdir):
|
||||
def setup_command(request, tempdir, rootdir):
|
||||
"""
|
||||
Run `setup.py build_sphinx` with args and kwargs,
|
||||
pass it to the test and clean up properly.
|
||||
@@ -38,8 +30,8 @@ def setup_command(request, tempdir):
|
||||
marker = request.node.get_marker('setup_command')
|
||||
args = marker.args if marker else []
|
||||
|
||||
pkgrootdir = tempdir / 'root'
|
||||
root.copytree(pkgrootdir)
|
||||
pkgrootdir = tempdir / 'test-setup'
|
||||
(rootdir / 'test-setup').copytree(pkgrootdir)
|
||||
|
||||
with cd(pkgrootdir):
|
||||
pythonpath = os.path.dirname(os.path.dirname(sphinx.__file__))
|
||||
@@ -89,7 +81,7 @@ def nonascii_srcdir(request, setup_command):
|
||||
try:
|
||||
(srcdir / mb_name).makedirs()
|
||||
except UnicodeEncodeError:
|
||||
from path import FILESYSTEMENCODING
|
||||
from sphinx.testing.path import FILESYSTEMENCODING
|
||||
pytest.skip(
|
||||
'non-ASCII filename not supported on this filesystem encoding: '
|
||||
'%s' % FILESYSTEMENCODING)
|
||||
|
Reference in New Issue
Block a user