summaryrefslogtreecommitdiff
path: root/tests/functional/u/unused/unused_import.py
blob: bd624dc76c880bff89def7d8a475726a1b5036a9 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
"""unused import"""
# pylint: disable=undefined-all-variable, import-error,  too-few-public-methods, missing-docstring,wrong-import-position, useless-object-inheritance, multiple-imports
import xml.etree  # [unused-import]
import xml.sax  # [unused-import]
import os.path as test  # [unused-import]
from sys import argv as test2  # [unused-import]
from sys import flags  # [unused-import]
# +1:[unused-import,unused-import]
from collections import deque, OrderedDict, Counter
import re, html.parser  # [unused-import]
DATA = Counter()
# pylint: disable=self-assigning-variable
from fake import SomeName, SomeOtherName  # [unused-import]
class SomeClass(object):
    SomeName = SomeName # https://bitbucket.org/logilab/pylint/issue/475
    SomeOtherName = 1
    SomeOtherName = SomeOtherName

from never import __all__
# pylint: disable=wrong-import-order,ungrouped-imports
import typing
from typing import TYPE_CHECKING


if typing.TYPE_CHECKING:
    import collections
if TYPE_CHECKING:
    import itertools


def get_ordered_dict() -> 'collections.OrderedDict':
    return []


def get_itertools_obj() -> 'itertools.count':
    return []

def use_html_parser() -> 'html.parser.HTMLParser':
    return html.parser.HTMLParser

# pylint: disable=misplaced-future

from __future__ import print_function

import os  # [unused-import]
import sys

class NonRegr(object):
    """???"""
    def __init__(self):
        print('initialized')

    def sys(self):
        """should not get sys from there..."""
        print(self, sys)

    def dummy(self, truc):
        """yo"""
        return self, truc

    def blop(self):
        """yo"""
        print(self, 'blip')

if TYPE_CHECKING:
    if sys.version_info >= (3, 6, 2):
        from typing import NoReturn