Skip to content

Commit eecb95f

Browse files
Backport PR #56109 on branch 2.1.x (CI: Ignore EncodingWarning in assert_produces_warning) (#56116)
Backport PR #56109: CI: Ignore EncodingWarning in assert_produces_warning Co-authored-by: Matthew Roeschke <[email protected]>
1 parent 24b9501 commit eecb95f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/_testing/_warnings.py

+7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
)
1414
import warnings
1515

16+
from pandas.compat import PY311
17+
1618
if TYPE_CHECKING:
1719
from collections.abc import (
1820
Generator,
@@ -179,6 +181,11 @@ def _assert_caught_no_extra_warnings(
179181
# due to these open files.
180182
if any("matplotlib" in mod for mod in sys.modules):
181183
continue
184+
if PY311 and actual_warning.category == EncodingWarning:
185+
# EncodingWarnings are checked in the CI
186+
# pyproject.toml errors on EncodingWarnings in pandas
187+
# Ignore EncodingWarnings from other libraries
188+
continue
182189
extra_warnings.append(
183190
(
184191
actual_warning.category.__name__,

0 commit comments

Comments
 (0)