Skip to content

Commit 05c32ba

Browse files
authored
CI: Ignore EncodingWarning in assert_produces_warning (#56109)
1 parent edbdf95 commit 05c32ba

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
@@ -14,6 +14,8 @@
1414
)
1515
import warnings
1616

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

0 commit comments

Comments
 (0)