qutebrowser/tests/unit
toofar 1c51e60195 Move tree tab moving and dragging tests to test_notree
This commit moves the tests around moving tree tabs into a unit test
targeting the notree library direction. The tests haven't changed but
they run much faster without having to spin up real tabs and windows.
I've left one complex test for each method in the end2end test to make
sure everything is still working there.

I've moved the existing `create_tree()` method into `test_notree.py` and
added a symmetric `tree_to_str()` method. I hope this makes the test
setup more readable than constructing Node objects directly or having
one fixed tree that all the tests operate on.

These tests run in about 150ms on my machine, vs about 20s when they
were using real tabs.

I've used a fancy typed NamedTuple to provide parameters for pytest
because it was quite difficult to discern the different tuple entries
when there was just three strings stacked on top each other. The keyword
arguments make it much more readable than the default pytest setup of
string parameter names and then a big list of tuples. Inspired by these
two posts:

https://til.simonwillison.net/pytest/namedtuple-parameterized-tests
https://mathspp.com/blog/til/better-test-parametrisation-in-pytest
2025-04-27 18:14:44 +12:00
..
api reuse: Initial copyright text update for myself 2023-07-23 12:49:05 +02:00
browser Shorten Chromium version in UA by default 2025-03-12 15:25:55 +01:00
commands Fix remaining references to old commands 2023-08-15 20:15:48 +02:00
completion Merge remote-tracking branch 'upstream/main' into tree-tabs-integration 2025-03-16 12:37:01 +13:00
components Use builtin list/dict/set/... types for annotations 2024-10-15 11:54:49 +02:00
config Shorten Chromium version in UA by default 2025-03-12 15:25:55 +01:00
extensions Revert "walk_module workaround for PyInstaller" 2023-10-28 10:44:55 +13:00
javascript Use str.removeprefix() and str.removesuffix() 2024-10-13 18:24:44 +02:00
keyinput Use str.removeprefix() and str.removesuffix() 2024-10-13 18:24:44 +02:00
mainwindow Move tree tab moving and dragging tests to test_notree 2025-04-27 18:14:44 +12:00
misc Move tree tab moving and dragging tests to test_notree 2025-04-27 18:14:44 +12:00
scripts Fix lint/tests 2023-07-23 14:10:10 +02:00
utils tests: Match message properly for invalid URL 2025-03-15 12:25:43 +01:00
test_app.py reuse: Initial copyright text update for myself 2023-07-23 12:49:05 +02:00
test_qt_machinery.py Use builtin list/dict/set/... types for annotations 2024-10-15 11:54:49 +02:00
test_qutebrowser.py reuse: Initial copyright text update for myself 2023-07-23 12:49:05 +02:00