diff options
author | Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> | 2022-08-18 22:13:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-18 22:13:23 +0200 |
commit | 82d55aee4ae3718b77fbec70e5d7d80c70adfa27 (patch) | |
tree | b8947faffa21e7401d176cc822ffe75191a18576 /tests/functional/o | |
parent | a2c57ec06070b6d2485082e3a131a087f8d6d921 (diff) | |
download | pylint-git-82d55aee4ae3718b77fbec70e5d7d80c70adfa27.tar.gz |
Remove Python 2 code from the tests & refactor (#7320)
- Refactor Classes which inherit from `object`.
- Remove `import print_function from __future__`.
- Remove assignments to `__revision__` from the functional test module when it is never used throughout the module.
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Diffstat (limited to 'tests/functional/o')
-rw-r--r-- | tests/functional/o/object_as_class_attribute.py | 5 | ||||
-rw-r--r-- | tests/functional/o/overloaded_operator.py | 6 | ||||
-rw-r--r-- | tests/functional/o/overridden_final_method_py38.py | 2 |
3 files changed, 6 insertions, 7 deletions
diff --git a/tests/functional/o/object_as_class_attribute.py b/tests/functional/o/object_as_class_attribute.py index 2ac729b36..8e44abcb9 100644 --- a/tests/functional/o/object_as_class_attribute.py +++ b/tests/functional/o/object_as_class_attribute.py @@ -1,4 +1,4 @@ -# pylint: disable=too-few-public-methods,useless-object-inheritance +# pylint: disable=too-few-public-methods """Test case for the problem described below : - A class extends 'object' - This class defines its own __init__() @@ -9,9 +9,8 @@ object.__init__() """ -__revision__ = None -class Statement(object): +class Statement: """ ... """ def __init__(self): pass diff --git a/tests/functional/o/overloaded_operator.py b/tests/functional/o/overloaded_operator.py index c14fb651f..d375238dd 100644 --- a/tests/functional/o/overloaded_operator.py +++ b/tests/functional/o/overloaded_operator.py @@ -1,8 +1,8 @@ -# pylint: disable=missing-docstring,too-few-public-methods,useless-object-inheritance +# pylint: disable=missing-docstring,too-few-public-methods """#3291""" -from __future__ import print_function -class Myarray(object): + +class Myarray: def __init__(self, array): self.array = array diff --git a/tests/functional/o/overridden_final_method_py38.py b/tests/functional/o/overridden_final_method_py38.py index 26498e777..252ea3c01 100644 --- a/tests/functional/o/overridden_final_method_py38.py +++ b/tests/functional/o/overridden_final_method_py38.py @@ -1,7 +1,7 @@ """Since Python version 3.8, a method decorated with typing.final cannot be overridden""" -# pylint: disable=useless-object-inheritance, missing-docstring, too-few-public-methods +# pylint: disable=missing-docstring, too-few-public-methods from typing import final |