[Grok-dev] solving the grok.template() bug - part A of the solution

Martijn Faassen faassen at startifact.com
Mon Jan 12 15:32:38 EST 2009


Hey,

Jan-Wijbrand Kolman wrote:
[snip]
> 1) Martian's tests use the FakeModule extensively to make tests a bit
> easier to read (one does not need to refer to the actual modules while
> reading the test cases). My implementation of finding the module of a
> baseclass breaks on the use of FakeModule.
> 
> I see two possible solutions: a) make FakeModule work with resolving
> modules from module names (although I did not see an easy way) or b)
> remove the FakeModule construct and define the test fixtures as normal
> modules again.

I've made this work now. Instead of fake_import you can properly import 
fake modules now from a special 'martiantest.fake' namespace. 
'resolve()' also works, so you should be able to resolve fake modules 
from module names now.

Ironically enough I've introduced a metaclass to implement this 
FakeModule behavior. :)

Regards,

Martijn



More information about the Grok-dev mailing list