Skip to content

Support pytest 9.2 across Python plugins - #487

Merged
brianstrauch merged 3 commits into
mainfrom
fix/python-pytest-9-2
Nov 12, 2026
Merged

brianstrauch merged 3 commits into
mainfrom
fix/python-pytest-9-2

Conversation

@brianstrauch

@brianstrauch brianstrauch commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Pytest 9.2 removed fixture-manager internals used by pytest-asyncio 0.21, causing nightly tests to fail during collection. Upgrade all 11 Python plugins and the plugin template to pytest >=9.2,<10 and pytest-asyncio >=1.4.1,<2.

Replace custom event_loop fixtures with pytest-asyncio's session loop configuration so Temporal's session-scoped environment, async fixtures, and tests continue sharing one loop. Remove obsolete untyped-decorator suppressions and the Google GenAI pytest cap. Every Python minimum and runtime dependency remains unchanged; lockfile version changes are limited to pytest, pytest-asyncio, and its Python 3.10 asyncio runner backport.

Validation:

  • make sync, make lint, and make test PYTEST_ARGS="-n 2 -q" pass for all 11 plugins on Python 3.14: 2,459 tests passed.
  • MCP also passes all 130 tests on Python 3.10.
  • Repository conventions and all 519 tooling tests pass.

This is the base for #447, which retains the OpenInference tracing changes. Addresses #476, #477, #479, #480, #481, #482, #483, and #484; their automated nightly issues remain open until a green latest-dependency run closes them.

@campoy campoy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…#447)

Depends on #487 for the shared pytest 9.2 and pytest-asyncio migration.
This PR contains only the OpenInference tracing fix, regression tests,
and README note.

OpenInference 2.6 rejects workflow and activity spans when their trace
root is owned by another processor or has already ended. Adapt
explicitly propagated Temporal context using a scoped non-recording
parent so workers retain the caller's trace, parent, and sampling
settings without emitting duplicate roots.

Attach callbacks to each processor instance so draining processors
retain span ownership and context cleanup across re-instrumentation.
Delegate the SDK processor tuple and lock through Temporal's wrapper so
OpenInference's registration and removal reach the actual processors.
Dependency constraints remain uncapped.

Regression coverage includes a separate client process, worker restarts,
concurrent remote parents, sampling, and processor draining.

Validation of this branch stacked on #487, on macOS / Python 3.14:
- Locked dependencies, including OpenInference 2.2: 602 tests passed;
one 2.6-specific draining test skipped.
- Latest allowed dependencies, including OpenInference 2.6 and Temporal
SDK 1.35: all 603 tests passed.
- make lint passes with both dependency sets.
- The two tracing commits are unchanged by the rebase, verified with git
range-diff. The committed lockfile is restored after latest-dependency
validation.

Addresses #444; the automated nightly issue remains open until a green
latest-dependency run closes it.
Regenerate Python lockfiles for the Python 3.11 minimum while preserving the pytest 9.2 migration and the OpenInference tracing changes.
@brianstrauch
brianstrauch merged commit 06959f4 into main Nov 12, 2026
65 checks passed
@brianstrauch
brianstrauch deleted the fix/python-pytest-9-2 branch November 12, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants