summaryrefslogtreecommitdiff
path: root/tests/functional/n/no/no_warning_docstring.py
blob: 315eeeaab0410b51cd9f2166c5692a1575a78854 (plain)
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
''' Test for inheritance '''
from __future__ import print_function
__revision__ = 1
# pylint: disable=too-few-public-methods, using-constant-test, useless-object-inheritance
class AAAA(object):
    ''' class AAAA '''

    def __init__(self):
        pass

    def method1(self):
        ''' method 1 '''
        print(self)

    def method2(self):
        ''' method 2 '''
        print(self)

class BBBB(AAAA):
    ''' class BBBB '''

    def __init__(self):
        AAAA.__init__(self)

    # should ignore docstring calling from class AAAA
    def method1(self):
        AAAA.method1(self)

class CCCC(BBBB):
    ''' class CCCC '''

    def __init__(self):
        BBBB.__init__(self)

    # should ignore docstring since CCCC is inherited from BBBB which is
    # inherited from AAAA containing method2
    if __revision__:
        def method2(self):
            AAAA.method2(self)
    else:
        def method2(self):
            AAAA.method1(self)