MCPcopy Index your code
hub / github.com/ipython/ipython / test_external_changed_api

Function test_external_changed_api

tests/test_guarded_eval.py:90–100  ·  view source on GitHub ↗

Check that the execution rejects if external API changed paths

(monkeypatch)

Source from the content-addressed store, hash-verified

88
89@dec.skip_without("pandas")
90def test_external_changed_api(monkeypatch):
91 """Check that the execution rejects if external API changed paths"""
92 import pandas as pd
93
94 series = pd.Series([1], index=["a"])
95
96 with monkeypatch.context() as m:
97 m.delattr(pd, "Series")
98 context = limited(data=series)
99 with pytest.raises(GuardRejection):
100 guarded_eval("data.iloc[0]", context)
101
102
103@dec.skip_without("pandas")

Callers

nothing calls this directly

Calls 2

guarded_evalFunction · 0.90
contextMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…