summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarc Mueller <30130371+cdce8p@users.noreply.github.com>2023-04-24 22:36:24 +0200
committerGitHub <noreply@github.com>2023-04-24 22:36:24 +0200
commit3ff19e4ca34fde316881d916f9df22d3104d6464 (patch)
tree22a51fd2384d9b1fe1f3fd005752155031dfd036 /tests
parentb36a6169069ad9694b63596eeaf2c95ce1c517f9 (diff)
downloadpylint-git-3ff19e4ca34fde316881d916f9df22d3104d6464.tar.gz
Drop support for Python 3.7 (#8609)
* Drop support for Python 3.7 * Update py-version + classifier * Update functional tests
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/b/bad_reversed_sequence_py37.py4
-rw-r--r--tests/functional/b/bad_reversed_sequence_py37.rc4
-rw-r--r--tests/functional/b/bad_reversed_sequence_py37.txt1
-rw-r--r--tests/functional/s/singledispatch/singledispatch_method_py37.rc4
-rw-r--r--tests/functional/s/star/star_needs_assignment_target_py38.py (renamed from tests/functional/s/star/star_needs_assignment_target_py37.py)0
-rw-r--r--tests/functional/s/star/star_needs_assignment_target_py38.rc (renamed from tests/functional/s/star/star_needs_assignment_target_py37.rc)2
-rw-r--r--tests/functional/s/star/star_needs_assignment_target_py38.txt (renamed from tests/functional/s/star/star_needs_assignment_target_py37.txt)0
-rw-r--r--tests/functional/u/undefined/undefined_loop_variable.py7
-rw-r--r--tests/functional/u/undefined/undefined_loop_variable.txt8
-rw-r--r--tests/test_pylint_runners.py7
-rw-r--r--tests/test_self.py10
-rw-r--r--tests/testutils/test_output_line.py7
12 files changed, 15 insertions, 39 deletions
diff --git a/tests/functional/b/bad_reversed_sequence_py37.py b/tests/functional/b/bad_reversed_sequence_py37.py
index 5a0b2124c..4f132d945 100644
--- a/tests/functional/b/bad_reversed_sequence_py37.py
+++ b/tests/functional/b/bad_reversed_sequence_py37.py
@@ -1,8 +1,8 @@
""" Dictionaries are reversible starting on python 3.8"""
-
# pylint: disable=missing-docstring
-reversed({'a': 1, 'b': 2}) # [bad-reversed-sequence]
+# This can't be detected since changes to locals aren't backported
+reversed({'a': 1, 'b': 2})
class InheritDict(dict):
diff --git a/tests/functional/b/bad_reversed_sequence_py37.rc b/tests/functional/b/bad_reversed_sequence_py37.rc
index 67a28a36a..77eb3be64 100644
--- a/tests/functional/b/bad_reversed_sequence_py37.rc
+++ b/tests/functional/b/bad_reversed_sequence_py37.rc
@@ -1,2 +1,2 @@
-[testoptions]
-max_pyver=3.8
+[main]
+py-version=3.7
diff --git a/tests/functional/b/bad_reversed_sequence_py37.txt b/tests/functional/b/bad_reversed_sequence_py37.txt
index 6fbbd2c59..da511347b 100644
--- a/tests/functional/b/bad_reversed_sequence_py37.txt
+++ b/tests/functional/b/bad_reversed_sequence_py37.txt
@@ -1,2 +1 @@
-bad-reversed-sequence:5:0:5:26::The first reversed() argument is not a sequence:UNDEFINED
bad-reversed-sequence:12:0:12:39::The first reversed() argument is not a sequence:UNDEFINED
diff --git a/tests/functional/s/singledispatch/singledispatch_method_py37.rc b/tests/functional/s/singledispatch/singledispatch_method_py37.rc
index 67a28a36a..77eb3be64 100644
--- a/tests/functional/s/singledispatch/singledispatch_method_py37.rc
+++ b/tests/functional/s/singledispatch/singledispatch_method_py37.rc
@@ -1,2 +1,2 @@
-[testoptions]
-max_pyver=3.8
+[main]
+py-version=3.7
diff --git a/tests/functional/s/star/star_needs_assignment_target_py37.py b/tests/functional/s/star/star_needs_assignment_target_py38.py
index fb5eea86a..fb5eea86a 100644
--- a/tests/functional/s/star/star_needs_assignment_target_py37.py
+++ b/tests/functional/s/star/star_needs_assignment_target_py38.py
diff --git a/tests/functional/s/star/star_needs_assignment_target_py37.rc b/tests/functional/s/star/star_needs_assignment_target_py38.rc
index 67a28a36a..d584aa959 100644
--- a/tests/functional/s/star/star_needs_assignment_target_py37.rc
+++ b/tests/functional/s/star/star_needs_assignment_target_py38.rc
@@ -1,2 +1,2 @@
[testoptions]
-max_pyver=3.8
+max_pyver=3.9
diff --git a/tests/functional/s/star/star_needs_assignment_target_py37.txt b/tests/functional/s/star/star_needs_assignment_target_py38.txt
index fb5a5faa6..fb5a5faa6 100644
--- a/tests/functional/s/star/star_needs_assignment_target_py37.txt
+++ b/tests/functional/s/star/star_needs_assignment_target_py38.txt
diff --git a/tests/functional/u/undefined/undefined_loop_variable.py b/tests/functional/u/undefined/undefined_loop_variable.py
index a00af5d79..10d6dc60b 100644
--- a/tests/functional/u/undefined/undefined_loop_variable.py
+++ b/tests/functional/u/undefined/undefined_loop_variable.py
@@ -1,11 +1,6 @@
# pylint: disable=missing-docstring,redefined-builtin, consider-using-f-string, unnecessary-direct-lambda-call, broad-exception-raised
-import sys
-
-if sys.version_info >= (3, 8):
- from typing import NoReturn
-else:
- from typing_extensions import NoReturn
+from typing import NoReturn
def do_stuff(some_random_list):
diff --git a/tests/functional/u/undefined/undefined_loop_variable.txt b/tests/functional/u/undefined/undefined_loop_variable.txt
index e10c9e002..78dc602ed 100644
--- a/tests/functional/u/undefined/undefined_loop_variable.txt
+++ b/tests/functional/u/undefined/undefined_loop_variable.txt
@@ -1,4 +1,4 @@
-undefined-loop-variable:14:11:14:14:do_stuff:Using possibly undefined loop variable 'var':UNDEFINED
-undefined-loop-variable:33:7:33:11::Using possibly undefined loop variable 'var1':UNDEFINED
-undefined-loop-variable:83:11:83:14:do_stuff_with_redefined_range:Using possibly undefined loop variable 'var':UNDEFINED
-undefined-loop-variable:201:11:201:20:find_even_number:Using possibly undefined loop variable 'something':UNDEFINED
+undefined-loop-variable:9:11:9:14:do_stuff:Using possibly undefined loop variable 'var':UNDEFINED
+undefined-loop-variable:28:7:28:11::Using possibly undefined loop variable 'var1':UNDEFINED
+undefined-loop-variable:78:11:78:14:do_stuff_with_redefined_range:Using possibly undefined loop variable 'var':UNDEFINED
+undefined-loop-variable:196:11:196:20:find_even_number:Using possibly undefined loop variable 'something':UNDEFINED
diff --git a/tests/test_pylint_runners.py b/tests/test_pylint_runners.py
index 29c4f90e8..f3baee24b 100644
--- a/tests/test_pylint_runners.py
+++ b/tests/test_pylint_runners.py
@@ -12,7 +12,7 @@ import shlex
import sys
from collections.abc import Sequence
from io import BufferedReader
-from typing import Any, NoReturn
+from typing import Any, NoReturn, Protocol
from unittest.mock import MagicMock, mock_open, patch
import pytest
@@ -22,11 +22,6 @@ from pylint.testutils import GenericTestReporter as Reporter
from pylint.testutils._run import _Run as Run
from pylint.testutils.utils import _test_cwd
-if sys.version_info >= (3, 8):
- from typing import Protocol
-else:
- from typing_extensions import Protocol
-
class _RunCallable(Protocol): # pylint: disable=too-few-public-methods
def __call__(self, argv: Sequence[str] | None = None) -> NoReturn | None:
diff --git a/tests/test_self.py b/tests/test_self.py
index 51a077665..48f914e35 100644
--- a/tests/test_self.py
+++ b/tests/test_self.py
@@ -10,7 +10,6 @@ import configparser
import contextlib
import json
import os
-import platform
import re
import subprocess
import sys
@@ -349,16 +348,9 @@ class TestRunTC:
assert isinstance(output, list)
assert len(output) == 1
assert isinstance(output[0], dict)
- # So each version wants a different column number...
- if platform.python_implementation() == "PyPy":
- column = 9
- elif sys.version_info >= (3, 8):
- column = 9
- else:
- column = 15
expected = {
"obj": "",
- "column": column,
+ "column": 9,
"line": 1,
"type": "error",
"symbol": "syntax-error",
diff --git a/tests/testutils/test_output_line.py b/tests/testutils/test_output_line.py
index c28c851ac..8e9cf2800 100644
--- a/tests/testutils/test_output_line.py
+++ b/tests/testutils/test_output_line.py
@@ -6,7 +6,7 @@
from __future__ import annotations
-import sys
+from typing import Protocol
import pytest
@@ -16,11 +16,6 @@ from pylint.message import Message
from pylint.testutils.output_line import OutputLine
from pylint.typing import MessageLocationTuple
-if sys.version_info >= (3, 8):
- from typing import Protocol
-else:
- from typing_extensions import Protocol
-
class _MessageCallable(Protocol):
def __call__(self, confidence: Confidence = HIGH) -> Message: