On Thu, Oct 11, 2018 at 2:19 PM Terry Brown <[email protected]> wrote:
> - Why can't we put unit tests near the code being tested? > > I'd argue (for Python) for using the best in class unit testing > framework's practice. pytest puts tests for > > .../foo/my_module.py->my_func() > > in > > .../foo/test/test_my_module.py->test_my_func() > Thanks for this. So for every @file x.py, we would create an @file test/x.py. It's a reasonable solution. Leo makes the idea of "near" meaningless, there's plenty of ways to jump > between these pieces of code easily. > Hmm. This suggests creating unl's linking code to their tests. These tests could be @test nodes or @file nodes containing, say, pytest test functions. I should have thought of this before. It's a great solution. > As you said elsewhere "One of my biggest mistakes has been not using existing > tools." I don't feel that way about unit testing. @test nodes are easy-to-use wrappers around unitTest.TestCase. Their only real drawback is that setup and teardown aren't easy to do. > knowing I'm going to want to use pytest for any other project, causes me > to not write unit tests for Leo. > You are welcome to create pytest unit tests for Leo. They don't have to reside in unitTest.leo. unitTest.leo already scans for doctests in all of Leo's core files. It could easily run pytest on all test files in leo/core/test. I've just created #994 <https://github.com/leo-editor/leo-editor/issues/994> for this. > > - Why can't we use javascript, or prolog within Leo? > > The richtext plugin runs a WYSIWYG HTML editor in javascript in Leo, so > I think javascript shouldn't be hard. Chances are the plugins broken / > needs maintenance, and while we could blame Qt's web support history > for that, to be fair all code needs maintenance. > The plugin uses QtWebKit, which doesn't get as much development work as Mozilla, Chrome, etc. What I want is to use javascript in a separate process, communicating with both Leo and your favorite browser. 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 post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
