Skip to content

Commit e7bfc7c

Browse files
committed
fix
Signed-off-by: Anatoly Myachev <[email protected]>
1 parent 4403972 commit e7bfc7c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: packages/python/plotly/plotly/tests/test_optional/test_px/test_px_input.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
@pytest.fixture
1515
def add_interchange_module_for_old_pandas():
1616
if not hasattr(pd.api, "interchange"):
17-
pd.api.interchange = mock.MagicMock()
18-
# to make the following import work: `import pandas.api.interchange`
19-
with mock.patch.dict(
20-
"sys.modules", {"pandas.api.interchange": pd.api.interchange}
21-
):
22-
yield
17+
with mock.patch.object(pd.api, "interchange", mock.MagicMock(), create=True):
18+
# to make the following import work: `import pandas.api.interchange`
19+
with mock.patch.dict(
20+
"sys.modules", {"pandas.api.interchange": pd.api.interchange}
21+
):
22+
yield
2323
else:
2424
yield
2525

0 commit comments

Comments
 (0)