Skip to content

Commit

Permalink
Backport PR pandas-dev#56109 on branch 2.1.x (CI: Ignore EncodingWarn…
Browse files Browse the repository at this point in the history
…ing in assert_produces_warning) (pandas-dev#56116)

Backport PR pandas-dev#56109: CI: Ignore EncodingWarning in assert_produces_warning

Co-authored-by: Matthew Roeschke <[email protected]>
  • Loading branch information
meeseeksmachine and mroeschke authored Nov 22, 2023
1 parent 24b9501 commit eecb95f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pandas/_testing/_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
)
import warnings

from pandas.compat import PY311

if TYPE_CHECKING:
from collections.abc import (
Generator,
Expand Down Expand Up @@ -179,6 +181,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

0 comments on commit eecb95f

Please sign in to comment.