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 |
||
|---|---|---|
| .. | ||
| statusbar | ||
| test_messageview.py | ||
| test_prompt.py | ||
| test_tabbedbrowser.py | ||
| test_tabwidget.py | ||
| test_treetabbedbrowser.py | ||