MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / test_init_jupyter_detection_nameerror

Function test_init_jupyter_detection_nameerror

tests/unit/test_init_py.py:56–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54
55
56def test_init_jupyter_detection_nameerror():
57 with patch("agentops.get_client") as mock_get_client:
58 mock_client = MagicMock()
59 mock_get_client.return_value = mock_client
60 # Simulate NameError when get_ipython() is called
61 import builtins
62
63 original_get_ipython = getattr(builtins, "get_ipython", None)
64 builtins.get_ipython = lambda: None # This will cause NameError
65 try:
66 agentops.init()
67 except NameError:
68 pass # Expected
69 finally:
70 if original_get_ipython:
71 builtins.get_ipython = original_get_ipython
72 else:
73 delattr(builtins, "get_ipython")
74
75
76def test_configure_valid_and_invalid_params():

Callers

nothing calls this directly

Calls 1

initMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…