Exemplo n.º 1
0
def remove_sphinx_builds():
    """ remove all build directories from the test folder
    """
    srcdirs = pathlib.Path(get_test_source_dir())
    for entry in srcdirs.iterdir():  # type: pathlib.Path
        if entry.is_dir() and entry.joinpath("_build").exists():
            shutil.rmtree(str(entry.joinpath("_build")))
Exemplo n.º 2
0
# -*- coding: utf-8 -*-
"""
    test_sphinx
    ~~~~~~~~~~~

    General Sphinx test and check output.
"""
import pytest
import sphinx

from ipypublish.sphinx.tests import get_test_source_dir

from ipypublish.tests.utils import HTML2JSONParser


@pytest.mark.sphinx(buildername="html", srcdir=get_test_source_dir("notebook"))
def test_basic(app, status, warning, get_sphinx_app_output, data_regression):

    app.build()

    assert "build succeeded" in status.getvalue()  # Build succeeded
    warnings = warning.getvalue().strip()
    assert warnings == ""

    output = get_sphinx_app_output(app, buildername="html")

    parser = HTML2JSONParser()
    parser.feed(output)
    if sphinx.version_info >= (2, ):
        data_regression.check(parser.parsed, basename="test_basic_v2")
    else:
Exemplo n.º 3
0
    test_sphinx
    ~~~~~~~~~~~

    General Sphinx test and check output.
"""
import sys
import pytest
import sphinx

from ipypublish.sphinx.tests import get_test_source_dir

from ipypublish.tests.utils import HTML2JSONParser


@pytest.mark.sphinx(buildername="html",
                    srcdir=get_test_source_dir("bibgloss_basic"))
def test_basic(app, status, warning, get_sphinx_app_output, data_regression):

    app.build()

    assert "build succeeded" in status.getvalue()  # Build succeeded
    warnings = warning.getvalue().strip()
    assert warnings == ""

    output = get_sphinx_app_output(app, buildername="html")

    parser = HTML2JSONParser()
    parser.feed(output)
    if sphinx.version_info >= (2, ):
        data_regression.check(parser.parsed, basename="test_basic_v2")
    else:
Exemplo n.º 4
0
# -*- coding: utf-8 -*-
"""
    test_sphinx
    ~~~~~~~~~~~

    General Sphinx test and check output.
"""
import re
import sys
import pytest

from ipypublish.sphinx.tests import get_test_source_dir


@pytest.mark.sphinx(buildername='html',
                    srcdir=get_test_source_dir('bibgloss_basic'))
def test_basic(app, status, warning, get_sphinx_app_output):

    app.build()

    assert 'build succeeded' in status.getvalue()  # Build succeeded
    warnings = warning.getvalue().strip()
    assert warnings == ""

    output = get_sphinx_app_output(app, buildername='html')

    assert re.search(('<a class="bibglossary bibgcapital reference internal" '
                      'href="#term1" id="id1">Name</a>'), output)
    assert re.search(('<a class="bibglossary reference internal" '
                      'href="#term2" id="id2">name2</a>'), output)
    assert re.search(('<a class="bibglossary reference internal" '
Exemplo n.º 5
0
"""
    test_sphinx
    ~~~~~~~~~~~

    General Sphinx test and check output.
"""
import re
from textwrap import dedent
import pytest

from ipypublish.sphinx.tests import get_test_source_dir


@pytest.mark.sphinx(
    buildername='html',
    srcdir=get_test_source_dir('notebook'))
def test_basic(app, status, warning, get_sphinx_app_output):

    app.build()

    assert 'build succeeded' in status.getvalue()  # Build succeeded
    warnings = warning.getvalue().strip()
    assert warnings == ""

    output = get_sphinx_app_output(app, buildername='html')

    assert re.search(
        dedent("""\
        <pre>

        This is some printed text,
Exemplo n.º 6
0
# -*- coding: utf-8 -*-
"""
    test_sphinx
    ~~~~~~~~~~~

    General Sphinx test and check output.
"""
import pytest
import sphinx

from ipypublish.sphinx.tests import get_test_source_dir

from ipypublish.tests.utils import HTML2JSONParser


@pytest.mark.sphinx(buildername='html', srcdir=get_test_source_dir('notebook'))
def test_basic(app, status, warning, get_sphinx_app_output, data_regression):

    app.build()

    assert 'build succeeded' in status.getvalue()  # Build succeeded
    warnings = warning.getvalue().strip()
    assert warnings == ''

    output = get_sphinx_app_output(app, buildername='html')

    parser = HTML2JSONParser()
    parser.feed(output)
    if sphinx.version_info >= (2,):
        data_regression.check(parser.parsed, basename='test_basic_v2')
    else: