summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-03-09 20:44:38 +0100
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-03-14 19:48:30 +0100
commitc41daa7d229823e18ce6106bef85e071d6910be1 (patch)
tree0e88c9f2ea4c28415747783be708fcaef6b9fbc4
parentcd50f416aeb1f8b66f152bdbf941b7a149a5939c (diff)
downloadpylint-git-c41daa7d229823e18ce6106bef85e071d6910be1.tar.gz
Migrate func_dotted_ancestor.py to new functional tests
-rw-r--r--tests/functional/d/dotted_ancestor.py (renamed from tests/input/func_dotted_ancestor.py)4
-rw-r--r--tests/functional/d/dotted_ancestor.txt1
-rw-r--r--tests/functional/d/func_w0233.py (renamed from tests/input/func_w0233.py)12
-rw-r--r--tests/functional/d/func_w0233.txt6
-rw-r--r--tests/messages/func_dotted_ancestor.txt1
-rw-r--r--tests/messages/func_w0233.txt6
-rw-r--r--tests/test_func.py2
7 files changed, 16 insertions, 16 deletions
diff --git a/tests/input/func_dotted_ancestor.py b/tests/functional/d/dotted_ancestor.py
index ff3285803..3c136591e 100644
--- a/tests/input/func_dotted_ancestor.py
+++ b/tests/functional/d/dotted_ancestor.py
@@ -1,11 +1,11 @@
"""bla"""
# pylint: disable=no-absolute-import
-from input import func_w0233
+from . import func_w0233
__revision__ = 'yo'
-class Aaaa(func_w0233.AAAA):
+class Aaaa(func_w0233.AAAA): # [too-few-public-methods]
"""test dotted name in ancestors"""
def __init__(self):
func_w0233.AAAA.__init__(self)
diff --git a/tests/functional/d/dotted_ancestor.txt b/tests/functional/d/dotted_ancestor.txt
new file mode 100644
index 000000000..4aa47e7c2
--- /dev/null
+++ b/tests/functional/d/dotted_ancestor.txt
@@ -0,0 +1 @@
+too-few-public-methods:8:0:Aaaa:Too few public methods (0/2)
diff --git a/tests/input/func_w0233.py b/tests/functional/d/func_w0233.py
index feb30c567..ca0345db3 100644
--- a/tests/input/func_w0233.py
+++ b/tests/functional/d/func_w0233.py
@@ -4,7 +4,7 @@
"""
from __future__ import print_function
from . import func_w0233
-import nonexistant
+import nonexistant # [import-error]
__revision__ = '$Id: func_w0233.py,v 1.2 2004-09-29 08:35:13 syt Exp $'
class AAAA(object):
@@ -12,7 +12,7 @@ class AAAA(object):
def __init__(self):
print('init', self)
- BBBBMixin.__init__(self)
+ BBBBMixin.__init__(self) # [non-parent-init-called]
class BBBBMixin(object):
"""ancestor 2"""
@@ -20,12 +20,12 @@ class BBBBMixin(object):
def __init__(self):
print('init', self)
-class CCC(BBBBMixin, func_w0233.AAAA, func_w0233.BBBB, nonexistant.AClass):
+class CCC(BBBBMixin, func_w0233.AAAA, func_w0233.BBBB, nonexistant.AClass): # [no-member]
"""mix different things, some inferable some not"""
def __init__(self):
BBBBMixin.__init__(self)
func_w0233.AAAA.__init__(self)
- func_w0233.BBBB.__init__(self)
+ func_w0233.BBBB.__init__(self) # [no-member]
nonexistant.AClass.__init__(self)
class DDDD(AAAA):
@@ -46,6 +46,6 @@ class Super2(dict):
""" Using the same idiom as Super, but without calling
the __init__ method.
"""
- def __init__(self):
+ def __init__(self): # [super-init-not-called]
base = super()
- base.__woohoo__()
+ base.__woohoo__() # [no-member]
diff --git a/tests/functional/d/func_w0233.txt b/tests/functional/d/func_w0233.txt
new file mode 100644
index 000000000..a05215ae2
--- /dev/null
+++ b/tests/functional/d/func_w0233.txt
@@ -0,0 +1,6 @@
+import-error:7:0::Unable to import 'nonexistant'
+non-parent-init-called:15:8:AAAA.__init__:__init__ method from a non direct base class 'BBBBMixin' is called
+no-member:23:38:CCC:Module 'functional.d.func_w0233' has no 'BBBB' member:INFERENCE
+no-member:28:8:CCC.__init__:Module 'functional.d.func_w0233' has no 'BBBB' member:INFERENCE
+super-init-not-called:49:4:Super2.__init__:__init__ method from base class 'dict' is not called
+no-member:51:8:Super2.__init__:Super of 'Super2' has no '__woohoo__' member:INFERENCE
diff --git a/tests/messages/func_dotted_ancestor.txt b/tests/messages/func_dotted_ancestor.txt
deleted file mode 100644
index 6e2c6fa5e..000000000
--- a/tests/messages/func_dotted_ancestor.txt
+++ /dev/null
@@ -1 +0,0 @@
-R: 8:Aaaa: Too few public methods (0/2)
diff --git a/tests/messages/func_w0233.txt b/tests/messages/func_w0233.txt
deleted file mode 100644
index de4f0fba9..000000000
--- a/tests/messages/func_w0233.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-E: 7: Unable to import 'nonexistant'
-E: 23:CCC: Module 'input.func_w0233' has no 'BBBB' member
-E: 28:CCC.__init__: Module 'input.func_w0233' has no 'BBBB' member
-E: 51:Super2.__init__: Super of 'Super2' has no '__woohoo__' member
-W: 15:AAAA.__init__: __init__ method from a non direct base class 'BBBBMixin' is called
-W: 49:Super2.__init__: __init__ method from base class 'dict' is not called
diff --git a/tests/test_func.py b/tests/test_func.py
index f96e53c28..891363f6a 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) < 19, "Please do not add new test cases here."
+ assert len(tests) < 18, "Please do not add new test cases here."
return tests