On Wed, Feb 24, 2010 at 8:38 AM, tfer <[email protected]> wrote:
> Unless things have changed, it should be pointed out that Leo's unit
> testing is only set up to work on Leo code, that is that code set up
> with unit testing can only be tested if it is run alongside Leo, not
> if it is python code written with Leo but run outside of it.
It's a matter of point of view. Obviously, @test nodes only work in
Leo, but the code inside @test nodes can be any code whatever.
> Changes would have to be made to allow Leo based unit testing
> functionality to be exported to standalone code.
Such a script could be written. It would physically place the body of
the @test node inside a synthesized run() method. That is, the script
would create something like:
class munged_test_name: (UnitTest.TestCase):
def run():
<< body of @test node >>
Or something like that. The munged name of the @test node could be
used as the name of the test case/class and as the name of the
external file.
I have no particular interest in doing this, as I have no particular
interest in working outside Leo, but the script would hardly be rocket
science. All patches gratefully accepted :-)
Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.