René's URL Explorer Experiment


Title: feat(testing): build_test_client(platform) — async context manager wrapping lifespan + httpx client · Issue #549 · adcontextprotocol/adcp-client-python · GitHub

Open Graph Title: feat(testing): build_test_client(platform) — async context manager wrapping lifespan + httpx client · Issue #549 · adcontextprotocol/adcp-client-python

X Title: feat(testing): build_test_client(platform) — async context manager wrapping lifespan + httpx client · Issue #549 · adcontextprotocol/adcp-client-python

Description: Summary build_asgi_app(platform) (PR #535) gives adopters the ASGI app they need for in-process integration tests. But every test that uses it writes the same 4 lines of boilerplate to wire the lifespan + transport + httpx client: ```pyt...

Open Graph Description: Summary build_asgi_app(platform) (PR #535) gives adopters the ASGI app they need for in-process integration tests. But every test that uses it writes the same 4 lines of boilerplate to wire the lif...

X Description: Summary build_asgi_app(platform) (PR #535) gives adopters the ASGI app they need for in-process integration tests. But every test that uses it writes the same 4 lines of boilerplate to wire the lif...

Opengraph URL: https://github.com/adcontextprotocol/adcp-client-python/issues/549

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat(testing): build_test_client(platform) — async context manager wrapping lifespan + httpx client","articleBody":"## Summary\n\n`build_asgi_app(platform)` (PR #535) gives adopters the ASGI app they need for in-process integration tests. But every test that uses it writes the same 4 lines of boilerplate to wire the lifespan + transport + httpx client:\n\n\\`\\`\\`python\nfrom asgi_lifespan import LifespanManager\nimport httpx\nfrom adcp.testing import build_asgi_app\n\nasync def test_something():\n    app = build_asgi_app(platform)\n    async with LifespanManager(app):\n        async with httpx.AsyncClient(\n            transport=httpx.ASGITransport(app=app),\n            base_url=\\\"http://test\\\",\n        ) as client:\n            resp = await client.post(\\\"/mcp\\\", json=...)\n            # finally — the actual test\n\\`\\`\\`\n\nA `build_test_client(platform)` helper that bundles those three layers into one async context manager collapses adopter test files significantly:\n\n\\`\\`\\`python\nfrom adcp.testing import build_test_client\n\nasync def test_something():\n    async with build_test_client(platform) as client:\n        resp = await client.post(\\\"/mcp\\\", json=...)\n\\`\\`\\`\n\n## Proposed shape\n\n\\`\\`\\`python\n@asynccontextmanager\nasync def build_test_client(\n    platform: DecisioningPlatform,\n    *,\n    base_url: str = \\\"http://test\\\",\n    name: str | None = None,\n    advertise_all: bool = False,\n    auto_emit_completion_webhooks: bool = False,\n    headers: Mapping[str, str] | None = None,\n    **factory_kwargs: Any,\n) -> AsyncIterator[httpx.AsyncClient]:\n    \\\"\\\"\\\"...\n    Yields an httpx.AsyncClient wired against the platform's ASGI app\n    via httpx.ASGITransport + LifespanManager. Closes both on exit.\n    \\\"\\\"\\\"\n    app = build_asgi_app(\n        platform,\n        name=name,\n        advertise_all=advertise_all,\n        auto_emit_completion_webhooks=auto_emit_completion_webhooks,\n        **factory_kwargs,\n    )\n    async with LifespanManager(app):\n        async with httpx.AsyncClient(\n            transport=httpx.ASGITransport(app=app),\n            base_url=base_url,\n            headers=dict(headers) if headers else None,\n        ) as client:\n            yield client\n\\`\\`\\`\n\n~25 LOC of implementation; surface mirrors `build_asgi_app` so adopters who outgrow the convenience helper drop down to the lower layer with no API rewrite.\n\nThe `headers=` kwarg is the small extra value-add — adopters testing the auth path use `headers={\\\"x-adcp-auth\\\": \\\"tok_...\\\"}` once at the client level instead of per-request.\n\n## Migration impact\n\n`asgi_lifespan` and `httpx` are already test-only deps in adopters using `build_asgi_app`. No new install. The helper makes them transitive for anyone using `build_test_client` (move them from per-test to a single import in their conftest).\n\n## Test count this would simplify\n\nsalesagent's `core/tests/test_e2e_get_products.py` and the M2-roadmap storyboard tests collapse by ~half. Multiplying across the framework's own test suite, the savings compound.\n\n## Related\n\n- Round-1 ask #11 (carried in salesagent SDK_FEEDBACK round-2 #24) was specifically the `build_asgi_app(platform)` helper — that shipped in PR #535 and closed the carry. ✅\n- This issue captures one of three smaller follow-up gaps that are independent of the round-1 ask:\n  - **(this issue)** `build_test_client` convenience — ~30 LOC, biggest UX win\n  - Returning handler/executor/registry from `build_asgi_app` for tests that need to inspect framework state — would file separately if helpful\n  - A2A test seam (today's `build_asgi_app` only mounts MCP) — would file separately as adopters start exercising A2A in tests\n\nHappy to PR this one if it'd help — small enough to be a 1-PR drive-by.\n\n🤖 Filed via Claude Code","author":{"url":"https://github.com/bokelley","@type":"Person","name":"bokelley"},"datePublished":"2026-05-04T02:33:07Z","url":"https://github.com/adcontextprotocol/adcp-client-python/issues/549"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:09ae2dc6-f7ff-2d83-f784-7decbc728e42
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id99FE:3C21B:100D4CF:14A68EF:6B010265
html-safe-noncebbe7ada735fe727b0c37bf6fef58de6d12188aebafe142c11867ac96e691d432
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OUZFOjNDMjFCOjEwMEQ0Q0Y6MTRBNjhFRjo2QjAxMDI2NSIsInZpc2l0b3JfaWQiOiI4MTAwODUzNjU4MzQzNzY4Njc3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacc715181c2e9801098949314802f16756faa172fa72b37479e2fb5e6a8b3ae15d
hovercard-subject-tagissue:4373701635
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/adcontextprotocol/adcp-client-python/549/issue_layout
twitter:imagehttps://opengraph.githubassets.com/9f371b050ac1bfd5b06dfe801eb7a90634c9ffa8739e80410ef036e704e33415/adcontextprotocol/adcp-client-python/issues/549
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/9f371b050ac1bfd5b06dfe801eb7a90634c9ffa8739e80410ef036e704e33415/adcontextprotocol/adcp-client-python/issues/549
og:image:altSummary build_asgi_app(platform) (PR #535) gives adopters the ASGI app they need for in-process integration tests. But every test that uses it writes the same 4 lines of boilerplate to wire the lif...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebokelley
hostnamegithub.com
expected-hostnamegithub.com
Nonecb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124
turbo-cache-controlno-preview
go-importgithub.com/adcontextprotocol/adcp-client-python git https://github.com/adcontextprotocol/adcp-client-python.git
octolytics-dimension-user_id221690821
octolytics-dimension-user_loginadcontextprotocol
octolytics-dimension-repository_id1090305973
octolytics-dimension-repository_nwoadcontextprotocol/adcp-client-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1090305973
octolytics-dimension-repository_network_root_nwoadcontextprotocol/adcp-client-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/adcontextprotocol/adcp-client-python/issues/549#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fadcontextprotocol%2Fadcp-client-python%2Fissues%2F549
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fadcontextprotocol%2Fadcp-client-python%2Fissues%2F549
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=adcontextprotocol%2Fadcp-client-python
Reloadhttps://github.com/adcontextprotocol/adcp-client-python/issues/549
Reloadhttps://github.com/adcontextprotocol/adcp-client-python/issues/549
Reloadhttps://github.com/adcontextprotocol/adcp-client-python/issues/549
adcontextprotocolhttps://github.com/adcontextprotocol
adcp-client-pythonhttps://github.com/adcontextprotocol/adcp-client-python
Codehttps://github.com/adcontextprotocol/adcp-client-python
Issues44 (44)https://github.com/adcontextprotocol/adcp-client-python/issues
Pull requests13 (13)https://github.com/adcontextprotocol/adcp-client-python/pulls
Actionshttps://github.com/adcontextprotocol/adcp-client-python/actions
Projectshttps://github.com/adcontextprotocol/adcp-client-python/projects
Security and qualityhttps://github.com/adcontextprotocol/adcp-client-python/security
Insightshttps://github.com/adcontextprotocol/adcp-client-python/insights
https://github.com/adcontextprotocol/adcp-client-python
New issuehttps://github.com/login?return_to=https://github.com/adcontextprotocol/adcp-client-python/issues/549
New issuehttps://github.com/login?return_to=https://github.com/adcontextprotocol/adcp-client-python/issues/549
#554https://github.com/adcontextprotocol/adcp-client-python/pull/554
feat(testing): build_test_client(platform) — async context manager wrapping lifespan + httpx clienthttps://github.com/adcontextprotocol/adcp-client-python/issues/549#top
#554https://github.com/adcontextprotocol/adcp-client-python/pull/554
claude-triagedhttps://github.com/adcontextprotocol/adcp-client-python/issues?q=state%3Aopen%20label%3A%22claude-triaged%22
enhancementNew feature or requesthttps://github.com/adcontextprotocol/adcp-client-python/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com/bokelley
bokelleyhttps://github.com/bokelley
on May 4, 2026https://github.com/adcontextprotocol/adcp-client-python/issues/549#issue-4373701635
#535https://github.com/adcontextprotocol/adcp-client-python/pull/535
http://test\http://test%5C
http://test\http://test%5C
chore(main): release 1.0.2 #11https://github.com/adcontextprotocol/adcp-client-python/pull/11
ci: add conventional commit validation to CI pipeline #24https://github.com/adcontextprotocol/adcp-client-python/pull/24
feat(testing): make_request_context + build_asgi_app helpers #535https://github.com/adcontextprotocol/adcp-client-python/pull/535
bokelleyhttps://github.com/bokelley
claude-triagingTriage routine is actively working on this issue (1-3 min)https://github.com/adcontextprotocol/adcp-client-python/issues?q=state%3Aopen%20label%3A%22claude-triaging%22
on May 4, 2026https://github.com/adcontextprotocol/adcp-client-python/issues/549#event-25116196925
https://github.com/bokelley
bokelleyhttps://github.com/bokelley
on May 4, 2026https://github.com/adcontextprotocol/adcp-client-python/issues/549#issuecomment-4367908101
https://claude.ai/code/session_01UZyqrAkoJPCEz5VLerzxFvhttps://claude.ai/code/session_01UZyqrAkoJPCEz5VLerzxFv
Claude Codehttps://claude.ai/code
bokelleyhttps://github.com/bokelley
enhancementNew feature or requesthttps://github.com/adcontextprotocol/adcp-client-python/issues?q=state%3Aopen%20label%3A%22enhancement%22
claude-triagedhttps://github.com/adcontextprotocol/adcp-client-python/issues?q=state%3Aopen%20label%3A%22claude-triaged%22
claude-triagingTriage routine is actively working on this issue (1-3 min)https://github.com/adcontextprotocol/adcp-client-python/issues?q=state%3Aopen%20label%3A%22claude-triaging%22
on May 4, 2026https://github.com/adcontextprotocol/adcp-client-python/issues/549#event-25116447124
bokelleyhttps://github.com/bokelley
on May 4, 2026https://github.com/adcontextprotocol/adcp-client-python/issues/549#event-25124524672
feat(testing): add build_test_client async context managerhttps://github.com/adcontextprotocol/adcp-client-python/commit/03af1280c65fc3c6f18cab0275a71dc140fa601f
https://docs.github.com/articles/closing-issues-via-commit-messages
03af128https://github.com/adcontextprotocol/adcp-client-python/commit/03af1280c65fc3c6f18cab0275a71dc140fa601f
feat(testing): add build_test_client async context managerhttps://github.com/adcontextprotocol/adcp-client-python/commit/ca55abe14b813288541d8fcef78442c82fe94316
https://docs.github.com/articles/closing-issues-via-commit-messages
ca55abehttps://github.com/adcontextprotocol/adcp-client-python/commit/ca55abe14b813288541d8fcef78442c82fe94316
feat(testing): add build_test_client async context managerhttps://github.com/adcontextprotocol/adcp-client-python/commit/65134a86d36e2e135b476351ce4cc629f3b8756b
https://docs.github.com/articles/closing-issues-via-commit-messages
65134a8https://github.com/adcontextprotocol/adcp-client-python/commit/65134a86d36e2e135b476351ce4cc629f3b8756b
bokelleyhttps://github.com/bokelley
completedhttps://github.com/adcontextprotocol/adcp-client-python/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#554https://github.com/adcontextprotocol/adcp-client-python/pull/554
on May 4, 2026https://github.com/adcontextprotocol/adcp-client-python/issues/549#event-25134124268
bokelleyhttps://github.com/bokelley
on May 4, 2026https://github.com/adcontextprotocol/adcp-client-python/issues/549#event-25134124281
feat(testing): add build_test_client async context manager (#554)https://github.com/adcontextprotocol/adcp-client-python/commit/5f038e5cc442173ed3e2726e38f856610d898473
#554https://github.com/adcontextprotocol/adcp-client-python/pull/554
https://docs.github.com/articles/closing-issues-via-commit-messages
5f038e5https://github.com/adcontextprotocol/adcp-client-python/commit/5f038e5cc442173ed3e2726e38f856610d898473
Sign up for freehttps://github.com/signup?return_to=https://github.com/adcontextprotocol/adcp-client-python/issues/549
Sign in to commenthttps://github.com/login?return_to=https://github.com/adcontextprotocol/adcp-client-python/issues/549
claude-triagedhttps://github.com/adcontextprotocol/adcp-client-python/issues?q=state%3Aopen%20label%3A%22claude-triaged%22
enhancementNew feature or requesthttps://github.com/adcontextprotocol/adcp-client-python/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.