summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-03-07 21:56:44 +0100
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-03-07 22:59:36 +0100
commit7e4c3fa6193441a6bbf91c464138fc950d3e9e62 (patch)
treefd7ebe36a939a3dc51a43e82d7655150b7a7f300
parente1a7f0afa8f8a55587b99eb6a3fde7d0510e6b49 (diff)
downloadpylint-git-7e4c3fa6193441a6bbf91c464138fc950d3e9e62.tar.gz
Migrate func_noerror_new_style_class_py_30.py to new functional tests
-rw-r--r--tests/functional/n/new_style_class_py_30.py (renamed from tests/input/func_noerror_new_style_class_py_30.py)24
-rw-r--r--tests/functional/n/new_style_class_py_30.txt4
2 files changed, 11 insertions, 17 deletions
diff --git a/tests/input/func_noerror_new_style_class_py_30.py b/tests/functional/n/new_style_class_py_30.py
index a33ae19f4..fd78c5590 100644
--- a/tests/input/func_noerror_new_style_class_py_30.py
+++ b/tests/functional/n/new_style_class_py_30.py
@@ -1,45 +1,35 @@
-"""check builtin data descriptors such as mode and name attributes
-on a file are correctly handled
+"""check builtin data descriptors such as mode and name attributes on a file are correctly handled
bug notified by Pierre Rouleau on 2005-04-24
"""
from __future__ import print_function
__revision__ = None
-class File(file): # pylint: disable=file-builtin
- """ Testing new-style class inheritance from file"""
- #
+class File(file): # pylint: disable=file-builtin,undefined-variable
+ """ Testing new-style class inheritance from file"""
def __init__(self, name, mode="r", buffering=-1, verbose=False):
"""Constructor"""
-
self.was_modified = False
self.verbose = verbose
- super(File, self).__init__(name, mode, buffering)
+ super(File, self).__init__(name, mode, buffering) # [super-with-arguments]
if self.verbose:
print("File %s is opened. The mode is: %s" % (self.name,
self.mode))
- #
def write(self, a_string):
""" Write a string to the file."""
-
- super(File, self).write(a_string)
+ super(File, self).write(a_string) # [super-with-arguments]
self.was_modified = True
- #
def writelines(self, sequence):
""" Write a sequence of strings to the file. """
-
- super(File, self).writelines(sequence)
+ super(File, self).writelines(sequence) # [super-with-arguments]
self.was_modified = True
- #
def close(self):
"""Close the file."""
-
if self.verbose:
print("Closing file %s" % self.name)
-
- super(File, self).close()
+ super(File, self).close() # [super-with-arguments]
self.was_modified = False
diff --git a/tests/functional/n/new_style_class_py_30.txt b/tests/functional/n/new_style_class_py_30.txt
new file mode 100644
index 000000000..1f3434378
--- /dev/null
+++ b/tests/functional/n/new_style_class_py_30.txt
@@ -0,0 +1,4 @@
+super-with-arguments:15:8:File.__init__:Consider using Python 3 style super() without arguments
+super-with-arguments:22:8:File.write:Consider using Python 3 style super() without arguments
+super-with-arguments:27:8:File.writelines:Consider using Python 3 style super() without arguments
+super-with-arguments:34:8:File.close:Consider using Python 3 style super() without arguments