()
| 54 | |
| 55 | |
| 56 | def 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 | |
| 76 | def test_configure_valid_and_invalid_params(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…