Skip to content

CI: Ignore EncodingWarning in assert_produces_warning #56109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pandas/_testing/_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
)
import warnings

from pandas.compat import PY311

if TYPE_CHECKING:
from collections.abc import (
Generator,
Expand Down Expand Up @@ -180,6 +182,11 @@ def _assert_caught_no_extra_warnings(
# due to these open files.
if any("matplotlib" in mod for mod in sys.modules):
continue
if PY311 and actual_warning.category == EncodingWarning:
# EncodingWarnings are checked in the CI
# pyproject.toml errors on EncodingWarnings in pandas
# Ignore EncodingWarnings from other libraries
continue
extra_warnings.append(
(
actual_warning.category.__name__,
Expand Down