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

Tests fail with pytest-asyncio>=0.25.0 #5511

Open
gepbird opened this issue Feb 10, 2025 · 3 comments
Open

Tests fail with pytest-asyncio>=0.25.0 #5511

gepbird opened this issue Feb 10, 2025 · 3 comments

Comments

@gepbird
Copy link

gepbird commented Feb 10, 2025

Tested with textual version 1.0.0 and python version 3.12.8

When updating pytest-asyncio to from 0.24.0 to 0.25.0, some tests start failing:

=========================== short test summary info ============================
FAILED tests/test_focus.py::test_focus_chain - RuntimeError: There is no current event loop in thread 'MainThread'.
FAILED tests/test_focus.py::test_allow_focus - RuntimeError: There is no current event loop in thread 'MainThread'.
FAILED tests/test_focus.py::test_focus_next_and_previous_with_type_selector_without_self - RuntimeError: There is no current event loop in thread 'MainThread'.
ERROR tests/test_focus.py::test_focus_next_wrap_around - RuntimeError: There is no current event loop in thread 'MainThread'.
ERROR tests/test_focus.py::test_focus_next_and_previous - RuntimeError: There is no current event loop in thread 'MainThread'.
ERROR tests/test_focus.py::test_focus_previous_wrap_around - RuntimeError: There is no current event loop in thread 'MainThread'.
ERROR tests/test_focus.py::test_no_focus_empty_selector - RuntimeError: There is no current event loop in thread 'MainThread'.
ERROR tests/test_focus.py::test_wrap_around_selector - RuntimeError: There is no current event loop in thread 'MainThread'.
ERROR tests/test_focus.py::test_focus_next_and_previous_with_type_selector - RuntimeError: There is no current event loop in thread 'MainThread'.
ERROR tests/test_focus.py::test_focus_next_and_previous_with_str_selector - RuntimeError: There is no current event loop in thread 'MainThread'.
ERROR tests/test_focus.py::test_focus_next_and_previous_with_str_selector_without_self - RuntimeError: There is no current event loop in thread 'MainThread'.

Re-running just the failed tests makes them pass, to reproduce this you need to run the whole test suite or at least a larger part.

Possibly related upstream issues:

We noticed this failure in nixpkgs where we recently bumped many python packages and some of textual's tests started failing: https://hydra.nixos.org/job/nixpkgs/trunk/python312Packages.textual.x86_64-linux

Textual Diagnostics

Versions

Name Value
Textual 1.0.0
Rich 13.9.4

Python

Name Value
Version 3.12.8
Implementation CPython
Compiler GCC 14.2.1 20241116
Executable /home/gep/.cache/pypoetry/virtualenvs/textual-y4dff5Fy-py3.12/bin/python

Operating System

Name Value
System Linux
Release 6.12.10-zen1
Version #1-NixOS ZEN SMP PREEMPT_DYNAMIC Tue Jan 1 00:00:00 UTC 1980

Terminal

Name Value
Terminal Application tmux (3.5a)
TERM screen
COLORTERM truecolor
FORCE_COLOR Not set
NO_COLOR Not set

Rich Console options

Name Value
size width=210, height=54
legacy_windows False
min_width 1
max_width 210
is_terminal False
encoding utf-8
max_height 54
justify None
overflow None
no_wrap False
highlight None
markup None
height None
Copy link

We found the following entry in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

@TomJGooding
Copy link
Contributor

TomJGooding commented Feb 12, 2025

I'm not familiar with packaging, but FWIW I don't think Textual will currently ever test using the latest version of pytest-asyncio. Textual still supports Python 3.8, whereas it looks like pytest-asyncio now requires Python 3.9.

@gepbird
Copy link
Author

gepbird commented Feb 12, 2025

Python 3.8 security support ended 4 months ago: https://endoflife.date/python. Is there a specific reason you want to support that?

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

No branches or pull requests

2 participants