Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(focus): update tests with app.run_test #5687

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TomJGooding
Copy link
Contributor

  • Update focus tests to run async with app.run_test rather than using app._context
  • Replace the screen fixture with a top-level test app class

This should hopefully fix problems with later versions of pytest-asyncio, where these tests would fail/error with: RuntimeError: There is no current event loop in thread 'MainThread'.

Fixes #5511

Please review the following checklist.

  • Docstrings on all new or modified functions / classes
  • Updated documentation
  • Updated CHANGELOG.md (where appropriate)

- Update focus tests to run async with `app.run_test` rather than using
  `app._context`
- Replace the screen fixture with a top-level test app class

This should hopefully fix problems with later versions of
`pytest-asyncio`, where these tests would fail/error with:
`RuntimeError: There is no current event loop in thread 'MainThread'.`

Fixes Textualize#5511
@TomJGooding TomJGooding marked this pull request as ready for review March 29, 2025 16:28
@Antiz96
Copy link

Antiz96 commented Apr 4, 2025

I can confirm this fixes #5511, thanks! 🤗

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.

Tests fail with pytest-asyncio>=0.25.0
2 participants