File: dummy.py

package info (click to toggle)
python-autodocsumm 0.2.14-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 536 kB
  • sloc: python: 985; makefile: 171; sh: 21
file content (111 lines) | stat: -rw-r--r-- 2,484 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
"""
Module for testing the autodocsumm

Just a dummy module with some class definitions
"""


#: to test if the data is included
test_data = None


def test_func():
    """Test if function is contained in autosummary"""
    pass


class Class_CallTest(object):
    """A class defining a __call__ method"""

    def __get__(self, instance, owner):
        return self

    def __set__(self, instance, value):
        """Actually not required. We just implement it to ensure the python
        "help" function works well"""
        pass

    def __call__(self, a, b):
        """
        Caller docstring for class attribute

        Parameters
        ----------
        a: any
            dummy parameter
        b: anything else
            second dummy parameter"""
        pass


class TestClass(object):
    """Class test for autosummary"""

    def __init__(self):
        #: This is an instance attribute
        self.instance_attribute = 1

    def test_method(self):
        """Test if the method is included"""
        pass

    def test_method_args_kwargs(self, *args, **kwargs):
        """The stars at args and kwargs should not be escaped"""

    class InnerClass(object):
        """A test for an inner class"""

    #: to test if the class attribute is included
    test_attr = None

    class_caller = Class_CallTest()

    #: data to be included
    large_data = 'Should be included'

    #: data to be skipped
    small_data = 'Should be skipped'


class TestException(Exception):
    """Exception test for autosummary"""

    def __init__(self):
        #: This is an exception attribute
        self.exception_instance_attribute = 1

    def test_exception_method(self):
        """Test if the method is included"""
        pass


class InheritedTestClass(TestClass):
    """Class test for inherited attributes"""


class TestClassWithInlineAutoClassSumm:
    """Class test for the autodocsummary inline

    .. autoclasssumm:: TestClassWithInlineAutoClassSumm

    This is after the summary.
    """

    def test_method_of_inline_test(self):
        """A test method."""
        pass


class TestClassWithRefToOtherClass:
    """Class test for the autodocsummary when a class attribute is a reference
    to another class. No autosummary of the class should be generated for
    the attribute. See also issue #69"""

    foo = TestClass


#: data to be skipped
large_data = 'Should also be skipped'

#: data to be included
small_data = 'Should also be included'