summaryrefslogtreecommitdiff
path: root/tests/pyreverse
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2022-11-23 04:04:58 -0500
committerGitHub <noreply@github.com>2022-11-23 10:04:58 +0100
commit694d3024dbfea06aefd9288a99d7a375fe100859 (patch)
treea5c9db9cfbbbf742efa4f84b4038ba16154d5783 /tests/pyreverse
parente2ef840528de633fdf8b826a9d7068345d8f371f (diff)
downloadpylint-git-694d3024dbfea06aefd9288a99d7a375fe100859.tar.gz
Fail pytest runs on warnings (#7809)
* Catch DeprecationWarning in pyreverse Follow-up to #6869 * Patch use of deprecated `astroid.node_classes` in test * Ignore DeprecationWarning in test_parseable_output_regression Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Diffstat (limited to 'tests/pyreverse')
-rw-r--r--tests/pyreverse/test_inspector.py5
-rw-r--r--tests/pyreverse/test_utils.py2
2 files changed, 5 insertions, 2 deletions
diff --git a/tests/pyreverse/test_inspector.py b/tests/pyreverse/test_inspector.py
index 623a828b5..00cad918f 100644
--- a/tests/pyreverse/test_inspector.py
+++ b/tests/pyreverse/test_inspector.py
@@ -9,6 +9,7 @@
from __future__ import annotations
import os
+import warnings
from collections.abc import Generator
from pathlib import Path
@@ -30,7 +31,9 @@ def project(get_project: GetProjectCallable) -> Generator[Project, None, None]:
with _test_cwd(TESTS):
project = get_project("data", "data")
linker = inspector.Linker(project)
- linker.visit(project)
+ with warnings.catch_warnings():
+ warnings.filterwarnings("ignore", category=DeprecationWarning)
+ linker.visit(project)
yield project
diff --git a/tests/pyreverse/test_utils.py b/tests/pyreverse/test_utils.py
index 1636a8896..d64bf4fa7 100644
--- a/tests/pyreverse/test_utils.py
+++ b/tests/pyreverse/test_utils.py
@@ -117,7 +117,7 @@ def test_infer_node_1(mock_infer: Any, mock_get_annotation: Any) -> None:
@patch("pylint.pyreverse.utils.get_annotation")
-@patch("astroid.node_classes.NodeNG.infer")
+@patch("astroid.nodes.NodeNG.infer")
def test_infer_node_2(mock_infer: Any, mock_get_annotation: Any) -> None:
"""Return set(node.infer()) when InferenceError is not raised and an
annotation has not been returned