Skip to content

Change logfire_pytest fixture scope to session#1758

Merged
jirikuncar merged 1 commit intomainfrom
pytest-scope-fixture
Mar 8, 2026
Merged

Change logfire_pytest fixture scope to session#1758
jirikuncar merged 1 commit intomainfrom
pytest-scope-fixture

Conversation

@jirikuncar
Copy link
Contributor

@jirikuncar jirikuncar commented Mar 6, 2026

The logfire_pytest fixture is changed from function to session scope since it provides a Logfire instance configured for the plugin which doesn't need to be recreated per test.

@jirikuncar jirikuncar requested a review from Copilot March 6, 2026 12:36
@jirikuncar jirikuncar self-assigned this Mar 6, 2026
@jirikuncar jirikuncar added the bug Bug related to the Logfire Python SDK label Mar 6, 2026
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 6, 2026

Deploying logfire-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9d88b91
Status: ✅  Deploy successful!
Preview URL: https://1257d013.logfire-docs.pages.dev
Branch Preview URL: https://pytest-scope-fixture.logfire-docs.pages.dev

View logs

devin-ai-integration[bot]

This comment was marked as resolved.

This comment was marked as resolved.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

devin-ai-integration[bot]

This comment was marked as resolved.

@jirikuncar jirikuncar force-pushed the pytest-scope-fixture branch from 9a2d574 to a8e66c0 Compare March 8, 2026 19:41
@jirikuncar jirikuncar changed the title Change logfire_pytest fixture to session scope and fix span hierarchy Change logfire_pytest fixture to session scope Mar 8, 2026
The logfire_pytest fixture only returns a configured Logfire instance and
doesn't need per-test isolation. Making it session-scoped avoids unnecessary
re-creation and allows it to be used by fixtures of any scope.
@jirikuncar jirikuncar force-pushed the pytest-scope-fixture branch from bcb1c14 to 9d88b91 Compare March 8, 2026 19:43
@jirikuncar jirikuncar changed the title Change logfire_pytest fixture to session scope Change logfire_pytest fixture scope to session Mar 8, 2026
@jirikuncar jirikuncar enabled auto-merge (squash) March 8, 2026 19:44
@jirikuncar jirikuncar merged commit 9f6a93e into main Mar 8, 2026
15 checks passed
@jirikuncar jirikuncar deleted the pytest-scope-fixture branch March 8, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Bug related to the Logfire Python SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants