summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-03-09 21:03:12 +0100
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-03-14 19:48:30 +0100
commitf9c45916843996b545c954a7ca958133fe7b1e95 (patch)
tree3721b7516a04926f577f227b0988fc1b4f06e59b
parentc41daa7d229823e18ce6106bef85e071d6910be1 (diff)
downloadpylint-git-f9c45916843996b545c954a7ca958133fe7b1e95.tar.gz
Migrate func_w0611.py to new functional tests
-rw-r--r--tests/functional/u/unused/unused_import.py24
-rw-r--r--tests/functional/u/unused/unused_import.txt1
-rw-r--r--tests/input/func_w0611.py25
-rw-r--r--tests/messages/func_w0611.txt1
-rw-r--r--tests/test_func.py2
5 files changed, 26 insertions, 27 deletions
diff --git a/tests/functional/u/unused/unused_import.py b/tests/functional/u/unused/unused_import.py
index 752f07ca8..c6c2f20be 100644
--- a/tests/functional/u/unused/unused_import.py
+++ b/tests/functional/u/unused/unused_import.py
@@ -37,3 +37,27 @@ def get_itertools_obj() -> 'itertools.count':
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')
diff --git a/tests/functional/u/unused/unused_import.txt b/tests/functional/u/unused/unused_import.txt
index 2dc892d9e..79ac42d10 100644
--- a/tests/functional/u/unused/unused_import.txt
+++ b/tests/functional/u/unused/unused_import.txt
@@ -7,3 +7,4 @@ unused-import:9:0::Unused OrderedDict imported from collections
unused-import:9:0::Unused deque imported from collections
unused-import:10:0::Unused import re
unused-import:13:0::Unused SomeOtherName imported from fake
+unused-import:45:0::Unused import os
diff --git a/tests/input/func_w0611.py b/tests/input/func_w0611.py
deleted file mode 100644
index 887787242..000000000
--- a/tests/input/func_w0611.py
+++ /dev/null
@@ -1,25 +0,0 @@
-"""check unused import
-"""
-# pylint: disable=no-absolute-import, useless-object-inheritance
-
-from __future__ import print_function
-
-import os
-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')
diff --git a/tests/messages/func_w0611.txt b/tests/messages/func_w0611.txt
deleted file mode 100644
index 2be0d0a8d..000000000
--- a/tests/messages/func_w0611.txt
+++ /dev/null
@@ -1 +0,0 @@
-W: 7: Unused import os
diff --git a/tests/test_func.py b/tests/test_func.py
index 891363f6a..ebcd2b5db 100644
--- a/tests/test_func.py
+++ b/tests/test_func.py
@@ -120,7 +120,7 @@ def gen_tests(filter_rgx):
tests.append((module_file, messages_file, dependencies))
if UPDATE_FILE.exists():
return tests
- assert len(tests) < 18, "Please do not add new test cases here."
+ assert len(tests) < 16, "Please do not add new test cases here."
return tests