summaryrefslogtreecommitdiff
path: root/setuptools/tests/test_sphinx_upload_docs.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2021-02-20 12:53:32 -0500
committerJason R. Coombs <jaraco@jaraco.com>2021-02-20 13:10:25 -0500
commit9be50723119ba4a636364b4dc17912f94d4632ec (patch)
tree82ef4cc317684e5c3d378144f0cecccae76e16dc /setuptools/tests/test_sphinx_upload_docs.py
parent9aee3bf752e0b052b6a6fbc01d56c3a49ccf0938 (diff)
downloadpython-setuptools-git-jaraco-path-build.tar.gz
Use path builder in upload_docs tests.jaraco-path-build
Diffstat (limited to 'setuptools/tests/test_sphinx_upload_docs.py')
-rw-r--r--setuptools/tests/test_sphinx_upload_docs.py27
1 files changed, 12 insertions, 15 deletions
diff --git a/setuptools/tests/test_sphinx_upload_docs.py b/setuptools/tests/test_sphinx_upload_docs.py
index a48ba7f8..cc5b8293 100644
--- a/setuptools/tests/test_sphinx_upload_docs.py
+++ b/setuptools/tests/test_sphinx_upload_docs.py
@@ -1,5 +1,6 @@
import pytest
-import os
+
+from jaraco import path
from setuptools.command.upload_docs import upload_docs
from setuptools.dist import Distribution
@@ -7,21 +8,17 @@ from setuptools.dist import Distribution
@pytest.fixture
def sphinx_doc_sample_project(tmpdir_cwd):
- # setup.py
- with open('setup.py', 'wt') as f:
- f.write('from setuptools import setup; setup()\n')
-
- os.makedirs('build/docs')
-
- # A test conf.py for Sphinx
- with open('build/docs/conf.py', 'w') as f:
- f.write("project = 'test'")
-
- # A test index.rst for Sphinx
- with open('build/docs/index.rst', 'w') as f:
- f.write(".. toctree::\
+ path.build({
+ 'setup.py': 'from setuptools import setup; setup()',
+ 'build': {
+ 'docs': {
+ 'conf.py': 'project="test"',
+ 'index.rst': ".. toctree::\
:maxdepth: 2\
- :caption: Contents:")
+ :caption: Contents:",
+ },
+ },
+ })
@pytest.mark.usefixtures('sphinx_doc_sample_project')