> Anyone have any ideas how an exec can modify the context of the
> caller?
http://docs.python.org/release/2.6.5/reference/simple_stmts.html#exec
is hard to read.
but I think you can write
exec g.findTestScript(c,'@common leoRst test code')
or
exec code_string in unified_context
or
exec code_string in globals_context, locals_context
you can do
exec code_string in globals(), locals()
although that seems to be offering code_string the opportunity to modify locals() without even knowing it's doing it.
Cheers -Terry
> but I think you can write
>
> exec g.findTestScript(c,'@common leoRst test code')
Sure, but I wanted to get rid of the explicit exec and put it in
g.findTestScript.
No matter. I'm resigned to the exec. It kinda growing on me.
Experimentation shows that it is *really* nice to be able to tweak the
test harness in unitTest.leo rather than leoTest.py. This is a
surprisingly big step forward.
Edward