summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2022-11-23 10:47:49 -0500
committerGitHub <noreply@github.com>2022-11-23 10:47:49 -0500
commited404d361f24f068693d59619961e575810af3d9 (patch)
tree8b561408e4044c33e8b6ed4eda7100fa935ea57f
parent7ebaad8b1790cf659fcb4017a57dd8686266a24a (diff)
downloadpylint-git-ed404d361f24f068693d59619961e575810af3d9.tar.gz
Catch UserWarning when linting stdlib (#7833)
-rw-r--r--tests/primer/test_primer_stdlib.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/primer/test_primer_stdlib.py b/tests/primer/test_primer_stdlib.py
index 0935c2c99..c2d879764 100644
--- a/tests/primer/test_primer_stdlib.py
+++ b/tests/primer/test_primer_stdlib.py
@@ -8,6 +8,7 @@ import contextlib
import io
import os
import sys
+import warnings
from collections.abc import Iterator
import pytest
@@ -60,7 +61,9 @@ def test_primer_stdlib_no_crash(
# Duplicate code takes too long and is relatively safe
# We don't want to lint the test directory which are repetitive
disables = ["--disable=duplicate-code", "--ignore=test"]
- Run([test_module_name] + enables + disables)
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", category=UserWarning)
+ Run([test_module_name] + enables + disables)
except SystemExit as ex:
out, err = capsys.readouterr()
assert not err, err