Exemplo n.º 1
0
def test_make_doc():

    # Create/remove files from tests/,
    # always return to original working directory
    owd = os.getcwd()
    os.chdir(os.path.dirname(__file__))
    try:
        names = [
            "axes_criteria",
            "coords_criteria",
            "all_criteria",
            "all_regex",
        ]
        tables_to_check = [f"_build/csv/{name}.csv" for name in names]
        remove_if_exists(tables_to_check)

        make_doc.main()
        assert all(os.path.exists(path) for path in tables_to_check)
    finally:
        os.chdir(owd)
Exemplo n.º 2
0
def test_make_doc():

    names = [
        "axes_criteria",
        "coords_criteria",
        "all_criteria",
        "all_regex",
    ]
    tables_to_check = [f"_build/csv/{name}.csv" for name in names]

    # Create _build/csv in a temporary directory
    owd = os.getcwd()
    with TemporaryDirectory() as tmpdirname:
        try:
            os.chdir(os.path.dirname(tmpdirname))
            make_doc.main()
            assert all(os.path.exists(path) for path in tables_to_check)
        finally:
            # Always return to original working directory
            os.chdir(owd)
Exemplo n.º 3
0
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

import datetime
import os
import sys

import sphinx_autosummary_accessors

import cf_xarray  # noqa
from cf_xarray.scripts import make_doc

make_doc.main()

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.insert(0, os.path.abspath('.'))

cwd = os.getcwd()
parent = os.path.dirname(cwd)
sys.path.insert(0, parent)

# -- General configuration -----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
# needs_sphinx = '1.0'