test(python): migrate integration tests to Client/AsyncClient API#997
Merged
test(python): migrate integration tests to Client/AsyncClient API#997
Conversation
…cClient API
Replace deprecated Session(notebook_id=...) and AsyncSession(notebook_id=...)
constructors with Client.create_notebook() / AsyncClient.create_notebook()
throughout the integration test suite. This eliminates deprecation warnings,
prevents autosave file pollution from test-{uuid} notebook IDs, and exercises
the same code paths that real users and the MCP server use.
Closes #995
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates all integration test fixtures and ad-hoc session creation in
test_daemon_integration.pyfrom the deprecatedSession(notebook_id=...)/AsyncSession(notebook_id=...)constructors to the supportedClient/AsyncClientAPI.clientandasync_clientfixtures that passsocket_pathdirectly (no moremonkeypatch.setenv)session,two_sessions,async_session,two_async_sessions, andconda_inline_sessionfixtures to useclient.create_notebook()/client.join_notebook()TestOpenNotebook,TestCreateNotebook,TestTrustApproval, andTestAsyncContextManagerfromSession.open_notebook()/Session.create_notebook()/DaemonClient()to theclientfixtureimport uuid(no longer needed withouttest-{uuid}notebook IDs)Session()in 4 "not connected" error-path tests (TestPresence) — these intentionally test disconnected session behaviorNet result: -143 lines, +54 lines. No test logic changes — only fixture setup.
Note: Tests that call
start_kernel()will need #994 to land first (fixes the "Disconnected from sync task" runtime lifecycle bug). This PR can be rebased after #993 and #994 merge.Verification
TestBasicConnectivity,TestOpenNotebook,TestCreateNotebook,TestTrustApprovalpass against a running dev daemontest-*orasync-test-*files created in repo root after running testsSession()error-path tests emit deprecation warningsCloses #995
PR submitted by @rgbkrk's agent, Quill