qutebrowser/tests/helpers
Florian Bruhin 9f16a1f879 tests: Properly delete mode_manager instances
To fix a flaky tests/unit/utils/usertypes/test_timer.py::test_early_timeout_check
(where a download-update timer from an earlier test fails), I looked into what
usertypes.Timer instances where left over after a test finished.

It turns out that there were about 190 still existing "partial-match" and
"normal-inhibited" timers when breaking in test_timer.py, even when just running
tests in tests/unit/browser/ and tests/unit/utils/usertypes.

This is because we pass qapp as parent to the ModeManager we create, but that
means it will be forever alive if we don't take care of cleaning it up after a
test.

Perhaps our tests should have some sort of mechanism that checks whether there
are any "leftovers" after a test has finished (perhaps even as part of
pytest-qt?), but for now, let's just fix the issues we can directly see.
2025-05-07 13:22:10 +02:00
..
fixtures.py tests: Properly delete mode_manager instances 2025-05-07 13:22:10 +02:00
logfail.py reuse: Initial copyright text update for myself 2023-07-23 12:49:05 +02:00
messagemock.py reuse: Initial copyright text update for myself 2023-07-23 12:49:05 +02:00
stubs.py Use Callable from collections.abc as well 2024-10-15 11:54:53 +02:00
test_helper_utils.py reuse: Initial copyright text update for myself 2023-07-23 12:49:05 +02:00
test_logfail.py reuse: Initial copyright text update for myself 2023-07-23 12:49:05 +02:00
test_stubs.py reuse: Initial copyright text update for myself 2023-07-23 12:49:05 +02:00
testutils.py tests: Disable MAP_DISCARD workaround for fixed Qt versions 2025-04-08 19:42:16 +02:00