summaryrefslogtreecommitdiff
path: root/tests/test_func.py
diff options
context:
space:
mode:
authorDaniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>2022-04-12 13:40:23 +0200
committerGitHub <noreply@github.com>2022-04-12 13:40:23 +0200
commitcd83ef4e5e4ae9576190e11b02bd0bc83a070ca5 (patch)
tree59d3af1322cb5fbe39fded035b428758a4760640 /tests/test_func.py
parent5c112dd133d954f6334602d88d14a6fe546c35e3 (diff)
downloadpylint-git-cd83ef4e5e4ae9576190e11b02bd0bc83a070ca5.tar.gz
Deprecate ``BaseChecker.config`` (#6278)
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Diffstat (limited to 'tests/test_func.py')
-rw-r--r--tests/test_func.py20
1 files changed, 9 insertions, 11 deletions
diff --git a/tests/test_func.py b/tests/test_func.py
index 2de78c5d0..207c9b8c9 100644
--- a/tests/test_func.py
+++ b/tests/test_func.py
@@ -123,19 +123,17 @@ TEST_WITH_EXPECTED_DEPRECATION = ["func_excess_escapes.py"]
gen_tests(FILTER_RGX),
ids=[o[0] for o in gen_tests(FILTER_RGX)],
)
-def test_functionality(module_file, messages_file, dependencies, recwarn):
+def test_functionality(
+ module_file, messages_file, dependencies, recwarn: pytest.WarningsRecorder
+) -> None:
__test_functionality(module_file, messages_file, dependencies)
- warning = None
- try:
- # Catch <unknown>:x: DeprecationWarning: invalid escape sequence
- # so it's not shown during tests
- warning = recwarn.pop()
- except AssertionError:
- pass
- if warning is not None:
+ if recwarn.list:
if module_file in TEST_WITH_EXPECTED_DEPRECATION and sys.version_info.minor > 5:
- assert issubclass(warning.category, DeprecationWarning)
- assert "invalid escape sequence" in str(warning.message)
+ assert any(
+ "invalid escape sequence" in str(i.message)
+ for i in recwarn.list
+ if issubclass(i.category, DeprecationWarning)
+ )
def __test_functionality(