qutebrowser/tests/unit/mainwindow
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
..
statusbar reuse: Update remaining copyright texts 2023-07-23 12:52:01 +02:00
test_messageview.py reuse: Initial copyright text update for myself 2023-07-23 12:49:05 +02:00
test_prompt.py reuse: Initial copyright text update for myself 2023-07-23 12:49:05 +02:00
test_tabbedbrowser.py reuse: Initial copyright text update for myself 2023-07-23 12:49:05 +02:00
test_tabwidget.py Fix tab widget benchmark tests 2024-02-06 12:36:17 +13:00
test_treetabbedbrowser.py Move tree tab moving and dragging tests to test_notree 2025-04-27 18:14:44 +12:00