Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a5f792b

Browse files
add fixture
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
1 parent 2fec0b2 commit a5f792b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

‎packages/python/plotly/plotly/tests/test_optional/test_px/test_px_input.py‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,18 @@ def test_build_df_with_index():
234234
assert_frame_equal(tips.reset_index()[out["data_frame"].columns], out["data_frame"])
235235

236236

237-
def test_build_df_using_interchange_protocol_mock():
237+
@pytest.fixture
238+
def add_interchange_module_for_old_pandas():
239+
if not hasattr(pd.api, "interchange"):
240+
pd.api.interchange = mock.MagicMock()
241+
# to make the following import work: `import pandas.api.interchange`
242+
with mock.patch.dict("sys.modules", {"pandas.api.interchange": pd.api.interchange}):
243+
yield
244+
else:
245+
yield
246+
247+
248+
def test_build_df_using_interchange_protocol_mock(add_interchange_module_for_old_pandas):
238249
class CustomDataFrame:
239250
def __dataframe__(self):
240251
pass

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /