As of rev 5650, Leo contains support for @testsetup nodes.  At present, I 
am pretty sure they work only when running unit tests locally.

In effect, @testsetup nodes provide common setup code for all following 
@test and @suite nodes.  Such common setup code is the real reason for 
having custom subclasses of unittest.TestCase.  This is a superb Leonine 
solution.  It is much than either

a) @testclass nodes (which I never use) or
b) "injecting" common test code using exec(g.findTestScript(c,'@common 
name-of-common-test-code'))

Leo's test-execution code prepends the body text of an @testsetup node to 
all following @test and @suite nodes.  Multiple @testsetup nodes may appear 
in an outline--the range of an @testsetup node extends over all following 
@test and @suite nodes until the next @testsetup node is seen (in outline 
order).  

This pattern is a direct result of the problems I have been having in the 
static type checking project.  The simplification of test code that has 
resulted is truly remarkable.  A single @testsetup node replaces <<setup>> 
sections that had to be present in every single test.  Hurray!

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 http://groups.google.com/group/leo-editor?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to