Move "only" directive tests to a seperate test root.

This commit is contained in:
Jonathan Waltman 2013-01-05 20:14:48 -06:00
parent 57289afc4e
commit 268b009017
6 changed files with 14 additions and 4 deletions

View File

@ -27,7 +27,6 @@ Contents:
doctest doctest
extensions extensions
versioning/index versioning/index
only
footnote footnote
i18n/index i18n/index

View File

@ -0,0 +1,2 @@
project = 'test-only-directive'

View File

@ -0,0 +1,6 @@
test-only-directive
===================
.. toctree::
only

View File

@ -17,10 +17,10 @@ from util import *
def teardown_module(): def teardown_module():
(test_root / '_build').rmtree(True) (test_roots / 'test-only-directive' / '_build').rmtree(True)
@with_app(buildername='text') @with_app(buildername='text', srcdir=(test_roots / 'test-only-directive'))
def test_sectioning(app): def test_sectioning(app):
def getsects(section): def getsects(section):

View File

@ -30,7 +30,7 @@ from nose import tools, SkipTest
__all__ = [ __all__ = [
'test_root', 'raises', 'raises_msg', 'test_root', 'test_roots', 'raises', 'raises_msg',
'skip_if', 'skip_unless', 'skip_unless_importable', 'Struct', 'skip_if', 'skip_unless', 'skip_unless_importable', 'Struct',
'ListOutput', 'TestApp', 'with_app', 'gen_with_app', 'ListOutput', 'TestApp', 'with_app', 'gen_with_app',
'path', 'with_tempdir', 'write_file', 'path', 'with_tempdir', 'write_file',
@ -39,6 +39,7 @@ __all__ = [
test_root = path(__file__).parent.joinpath('root').abspath() test_root = path(__file__).parent.joinpath('root').abspath()
test_roots = path(__file__).parent.joinpath('roots').abspath()
def _excstr(exc): def _excstr(exc):
@ -153,6 +154,8 @@ class TestApp(application.Sphinx):
self.cleanup_trees.insert(0, outdir) self.cleanup_trees.insert(0, outdir)
if doctreedir is None: if doctreedir is None:
doctreedir = srcdir.joinpath(srcdir, self.builddir, 'doctrees') doctreedir = srcdir.joinpath(srcdir, self.builddir, 'doctrees')
if not doctreedir.isdir():
doctreedir.makedirs()
if cleanenv: if cleanenv:
self.cleanup_trees.insert(0, doctreedir) self.cleanup_trees.insert(0, doctreedir)
if confoverrides is None: if confoverrides is None: