[Grok-dev] Get default directive

Martijn Faassen faassen at startifact.com
Wed Jan 6 19:32:21 EST 2010


Paul Wilson wrote:

> Also, context.txt contains the following test:
> 
> ----------------- %< ------------------
> There are too many possible contexts::
> 
>   >>> class ambiguouscontext(FakeModule):
>   ...   class A(Context):
>   ...     pass
>   ...   class B(Context):
>   ...     pass
>   ...   class C(object):
>   ...     pass
>   >>> from martiantest.fake import ambiguouscontext
>   >>> context.bind(get_default=get_default_context).get(ambiguouscontext.B)
>   Traceback (most recent call last):
>     ...
>   GrokError: Multiple possible contexts for <class
> 'martiantest.fake.ambiguouscontext.B'>, please use the 'context'
> directive.
> ----------------- %< ------------------
> 
> Shouldn't this be...
> 
> context.bind(get_default=get_default_context).get(ambiguouscontext.C)
> 
> ?? I was assuming that A and B were the ambiguous contexts, and C is
> the subject from which we should be deriving the context. 

I think you are right.

> Strangely,
> this test passes on trunk, but fails with my fake module version....

Before or after fixing it? Interesting!

Regards,

Martijn



More information about the Grok-dev mailing list