From 8cbb76ad74c4e8992a66e6a7fc322c3aaea52cb7 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Mon, 8 Mar 2021 22:02:17 +0100 Subject: Migrate func_unused_import_py30.py to new functional tests --- tests/functional/u/unused/unused_import_py30.py | 19 +++++++++++++++++++ tests/functional/u/unused/unused_import_py30.txt | 1 + tests/input/func_unused_import_py30.py | 20 -------------------- tests/messages/func_unused_import_py30.txt | 1 - 4 files changed, 20 insertions(+), 21 deletions(-) create mode 100644 tests/functional/u/unused/unused_import_py30.py create mode 100644 tests/functional/u/unused/unused_import_py30.txt delete mode 100644 tests/input/func_unused_import_py30.py delete mode 100644 tests/messages/func_unused_import_py30.txt diff --git a/tests/functional/u/unused/unused_import_py30.py b/tests/functional/u/unused/unused_import_py30.py new file mode 100644 index 000000000..95fed2055 --- /dev/null +++ b/tests/functional/u/unused/unused_import_py30.py @@ -0,0 +1,19 @@ +"""check unused import for metaclasses""" +# pylint: disable=too-few-public-methods,wrong-import-position,ungrouped-imports +__revision__ = 1 +import abc +import sys +from abc import ABCMeta +from abc import ABCMeta as SomethingElse # [reimported] + +class Meta(metaclass=abc.ABCMeta): + """ Test """ + def __init__(self): + self.data = sys.executable + self.test = abc + +class Meta2(metaclass=ABCMeta): + """ Test """ + +class Meta3(metaclass=SomethingElse): + """ test """ diff --git a/tests/functional/u/unused/unused_import_py30.txt b/tests/functional/u/unused/unused_import_py30.txt new file mode 100644 index 000000000..1a2ff4fb9 --- /dev/null +++ b/tests/functional/u/unused/unused_import_py30.txt @@ -0,0 +1 @@ +reimported:7:0::Reimport 'ABCMeta' (imported line 6) diff --git a/tests/input/func_unused_import_py30.py b/tests/input/func_unused_import_py30.py deleted file mode 100644 index 91a9e9ac9..000000000 --- a/tests/input/func_unused_import_py30.py +++ /dev/null @@ -1,20 +0,0 @@ -"""check unused import for metaclasses -""" -# pylint: disable=too-few-public-methods,wrong-import-position,ungrouped-imports -__revision__ = 1 -import abc -import sys -from abc import ABCMeta -from abc import ABCMeta as SomethingElse - -class Meta(metaclass=abc.ABCMeta): - """ Test """ - def __init__(self): - self.data = sys.executable - self.test = abc - -class Meta2(metaclass=ABCMeta): - """ Test """ - -class Meta3(metaclass=SomethingElse): - """ test """ diff --git a/tests/messages/func_unused_import_py30.txt b/tests/messages/func_unused_import_py30.txt deleted file mode 100644 index 1868abc2d..000000000 --- a/tests/messages/func_unused_import_py30.txt +++ /dev/null @@ -1 +0,0 @@ -W: 8: Reimport 'ABCMeta' (imported line 7) -- cgit v1.2.1