summaryrefslogtreecommitdiff
path: root/test/functional/names_in__all__.py
blob: acd94c33ce865aa295391136cc3338a821f2961d (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
43
44
45
46
# pylint: disable=too-few-public-methods,no-self-use
"""Test Pylint's use of __all__.

* NonExistant is not defined in this module, and it is listed in
  __all__. An error is expected.

* This module imports path and republished it in __all__. No errors
  are expected.
"""


from os import path
from collections import deque

__all__ = [
    'Dummy',
    'NonExistant',  # [undefined-all-variable]
    'path',
    'func',  # [undefined-all-variable]
    'inner',  # [undefined-all-variable]
    'InnerKlass', deque.__name__]  # [undefined-all-variable]


class Dummy(object):
    """A class defined in this module."""
    pass

DUMMY = Dummy()

def function():
    """Function docstring
    """
    pass

function()

class Klass(object):
    """A klass which contains a function"""
    def func(self):
        """A klass method"""
        inner = None
        print inner

    class InnerKlass(object):
        """A inner klass"""
        pass