mirror of
https://github.com/jazzband/django-configurations.git
synced 2026-04-24 16:54:50 +00:00
Clean up test runs and impove test coverage for sphinx
This commit is contained in:
parent
ea8d4deb58
commit
1e44daebef
1 changed files with 23 additions and 0 deletions
|
|
@ -1,14 +1,37 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import subprocess
|
||||
import os
|
||||
from shutil import rmtree
|
||||
|
||||
from django.test import TestCase
|
||||
from django.conf import settings
|
||||
from django.utils.six import StringIO
|
||||
from sphinx.application import Sphinx
|
||||
|
||||
|
||||
class SphinxTests(TestCase):
|
||||
docs_dir = os.path.join(settings.BASE_DIR, 'docs')
|
||||
|
||||
def tearDown(self):
|
||||
build_dir = os.path.join(self.docs_dir, '_build')
|
||||
if os.path.exists(build_dir):
|
||||
rmtree(build_dir)
|
||||
|
||||
def test_extension(self):
|
||||
stdout = StringIO()
|
||||
s = Sphinx(
|
||||
self.docs_dir,
|
||||
self.docs_dir,
|
||||
'%s/_build/html' % self.docs_dir,
|
||||
'%s/_build/doctrees' % self.docs_dir,
|
||||
'html',
|
||||
status=stdout,
|
||||
)
|
||||
s.build()
|
||||
output = stdout.getvalue()
|
||||
stdout.close()
|
||||
self.assertIn('build succeeded.', output)
|
||||
|
||||
def test_multiprocessing(self):
|
||||
output = subprocess.check_output([
|
||||
'sphinx-build',
|
||||
|
|
|
|||
Loading…
Reference in a new issue