Fixes #146 -- Adds multiprocessing support for sphinx

This commit is contained in:
Johannes Hoppe 2016-04-05 18:14:20 +02:00
parent 7701e86b75
commit cd596f6788
7 changed files with 58 additions and 0 deletions

View file

@ -32,3 +32,4 @@ def setup(app=None):
in your docs' ``conf.py``.
"""
_setup()
return {'version': __version__, 'parallel_read_safe': True}

30
tests/docs/conf.py Normal file
View file

@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir))
# setup Django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.main")
os.environ.setdefault('DJANGO_CONFIGURATION', 'Test')
extensions = [
'configurations',
]
# The suffix of source filenames.
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'django-configurations'
copyright = '2012-2014, Jannis Leidel and other contributors'
version = release = 'test'
exclude_patterns = ['_build']
html_theme = 'default'

2
tests/docs/index.rst Normal file
View file

@ -0,0 +1,2 @@
Test Documentation
^^^^^^^^^^^^^^^^^^

View file

@ -6,3 +6,4 @@ dj-email-url
dj-search-url
django-cache-url>=1.0.0
six
Sphinx>=1.4

View file

@ -7,6 +7,7 @@ from configurations.values import BooleanValue
class Test(Configuration):
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir))
ENV_LOADED = BooleanValue(False)

22
tests/test_sphinx.py Normal file
View file

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
import subprocess
import os
from django.test import TestCase
from django.conf import settings
class ShpinxTests(TestCase):
docs_dir = os.path.join(settings.BASE_DIR, 'docs')
def test_multiprocessing(self):
output = subprocess.check_output([
'sphinx-build',
'-b',
'html',
'-j 2',
'.',
'_build/html',
], cwd=self.docs_dir, stderr=subprocess.STDOUT)
self.assertIn(b'waiting for workers', output)
self.assertIn(b'build succeeded.', output)

View file

@ -2,6 +2,7 @@
skipsdist = True
usedevelop = True
minversion = 1.8
whitelist_externals=build-sphinx
envlist =
flake8-py27,
flake8-py35,