File tree 1 file changed +12
-1
lines changed
packages/python/plotly/plotly/tests/test_optional/test_px
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -234,7 +234,18 @@ def test_build_df_with_index():
234
234
assert_frame_equal (tips .reset_index ()[out ["data_frame" ].columns ], out ["data_frame" ])
235
235
236
236
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 ):
238
249
class CustomDataFrame :
239
250
def __dataframe__ (self ):
240
251
pass
You can’t perform that action at this time.
0 commit comments