Yesterday I said that I was unlikely to create a new unit test for #2164 <https://github.com/leo-editor/leo-editor/issues/2164>, a Qt6-related bug.
When I awoke this morning I said, "Doh! I must do exactly that!" Indeed, I'll create a unit test that tests *all* the Qt enums listed in #1973 <https://github.com/leo-editor/leo-editor/issues/1973>. *Support for Qt unit tests* Commit b4791a <https://github.com/leo-editor/leo-editor/pull/2159/commits/b4791ab484bced0374686050dbd38c8eafc62e54> adds support for Qt-based unit tests. There were a few complications, including screen flash. All such complications have been fixed. BTW, I just realized that commit-related diffs are much easier to understand than the "global" diffs in PR's. Most fixes involved adding guards on g.unitTesting. However, eventFilter crashed (after finishing all the tests!!) because g.app.gui no longer existed! No big deal. I just added a guard on g.app itself. *What happens in unit tests stays in unit tests?* I investigated calling create_app in setUp rather than in setUpClass, which would totally separate each unit test. However, test-all would take about one second longer. Imo, the extra time is *not *worthwhile. I've gotten addicted to *fast* unit tests! To repeat, g.unitTesting is *never *true while running Leo itself. For the first time, guards on g.unitTesting are completely benign! *Work flow* The new unit testing framework is much, *much*, *much*, better than the old. I make a change to Leo's core and run test-all or one of the other test-* commands. This is the way test-driven development is supposed to work. I do have to restart Leo when changing leoTest2.py, but that happens rarely. *Summary* Leo now can run unit tests using the Qt gui. Such unit tests do not show any Qt windows. The new work flow makes test-driven development feasible, a major boost to productivity. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/59e12851-ca69-4d50-b5e8-45d3154b8689n%40googlegroups.com.
