[py-dev] [py.test] import context problems (causes Django unit test failure)

Adrian Dziubek adrian.dziubek at gmail.com
Mon May 10 13:19:07 CEST 2010


2010/5/9 Adrian Dziubek <adrian.dziubek at gmail.com>:
> 2010/5/9 holger krekel <holger at merlinux.eu>:
>> Hi Adrian,
>>
>> For me on both py-1.2.1 and py-1.3.0 things seems to work fine when
>> i type in your example (on a a Mac machine).
>> could you zip up the exact directory?
> I did the test on my Linux laptop and it works fine too, strange...
> I'll try again tomorrow at work, where I left the original example.
> It's probably some setup problem then. Thanks for answering.

I cannot replicate it any more at work. I found a __init__.py file in
moduletest directory, but I can remember explicitly caring about not
putting it there... I must have been tired on Friday. I also realised
that Django puts __init__.py in the project directory, so it's no
wonder, that py.test treats the whole project as a package.

I'm still having problems with reverse() inside Django, but it seems
irrelevant to py.test.

Sorry for bothering, I'll remove the StackOverflow question too.
-- 
Adrian



More information about the Pytest-dev mailing list