Skip to content

Commit 30e551e

Browse files
committed
test(display): catch expected UserWarning in test_repr_mimebundle_selection_logic
1 parent b2f7cb0 commit 30e551e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/bigframes/tests/unit/display/test_render_mode.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
import unittest.mock as mock
1616

17+
import pytest
18+
1719
import bigframes.display.html as bf_html
1820
import bigframes.pandas as bpd
1921

@@ -63,7 +65,8 @@ def test_repr_mimebundle_selection_logic():
6365
# Test fallback to static deferred repr when anywidget fails
6466
mock_anywidget.side_effect = Exception("Anywidget failed")
6567
with bpd.option_context("display.repr_mode", "deferred"):
66-
bundle = bf_html.repr_mimebundle(mock_obj)
68+
with pytest.warns(UserWarning, match="Anywidget mode is not available"):
69+
bundle = bf_html.repr_mimebundle(mock_obj)
6770
assert bundle == {"text/plain": "deferred"}
6871
mock_deferred.assert_called_once()
6972

0 commit comments

Comments
 (0)