コード例 #1
0
@pytest.mark.parametrize(
    "fn", [fn for page in OUTLINE for fn in page.get("functions", [])])
def test_consistency_of_function_docs(fn):
    consistency_check(fn, f"{fn.__name__}")


@pytest.mark.parametrize(
    "obj", [obj for page in OUTLINE for obj in page.get("classes", [])])
def test_consistency_of_class_docs(obj):
    consistency_check(obj, f"{obj.__module__}.{obj.__name__}")


@pytest.mark.parametrize(
    "obj,fn",
    [(obj, fn) for page in OUTLINE for obj in page.get("classes", [])
     for fn in get_class_methods(obj)],
)  # parametrized like this for easy reading of tests
def test_consistency_of_class_method_docs(obj, fn):
    consistency_check(fn, f"{obj.__module__}.{obj.__name__}.{fn.__name__}")


def test_format_doc_removes_unnecessary_newlines_when_appropriate_in_tables():
    def doc_fun():
        """
        I am a
        poorly formatte
        d doc string.

        Args:
            - x (optional): actually not
                really here
コード例 #2
0
@pytest.mark.parametrize(
    "fn", [fn for page in OUTLINE for fn in page.get("functions", [])])
def test_consistency_of_function_docs(fn):
    consistency_check(fn, f"{fn.__name__}")


@pytest.mark.parametrize(
    "obj", [obj for page in OUTLINE for obj in page.get("classes", [])])
def test_consistency_of_class_docs(obj):
    consistency_check(obj, f"{obj.__module__}.{obj.__name__}")


@pytest.mark.parametrize(
    "obj,fn",
    [(obj, fn) for page in OUTLINE for obj in page.get("classes", [])
     for fn in get_class_methods(obj)],
)  # parametrized like this for easy reading of tests
def test_consistency_of_class_method_docs(obj, fn):
    consistency_check(fn, f"{obj.__module__}.{obj.__name__}.{fn.__name__}")


def test_format_doc_removes_unnecessary_newlines_when_appropriate_in_tables():
    def doc_fun():
        """
        I am a
        poorly formatte
        d doc string.

        Args:
            - x (optional): actually not
                really here
コード例 #3
0

@pytest.mark.parametrize(
    "obj", [obj for page in OUTLINE for obj, _ in page.get("classes", [])]
)
def test_consistency_of_class_docs(obj):
    consistency_check(obj, f"{obj.__module__}.{obj.__name__}")


@pytest.mark.parametrize(
    "obj,fn",
    [
        (obj, fn)
        for page in OUTLINE
        for obj, methods in page.get("classes", [])
        for fn in get_class_methods(obj, methods)
    ],
)  # parametrized like this for easy reading of tests
def test_consistency_of_class_method_docs(obj, fn):
    consistency_check(fn, f"{obj.__module__}.{obj.__name__}.{fn.__name__}")


def test_format_doc_removes_unnecessary_newlines_when_appropriate_in_tables():
    def doc_fun():
        """
        I am a
        poorly formatte
        d doc string.

        Args:
            - x (optional): actually not