[TIP] nose2 backwards compatibility questions

jason pellerin jpellerin at gmail.com
Wed Aug 11 07:59:30 PDT 2010


On Wed, Aug 11, 2010 at 10:54 AM, Michael Foord
<fuzzyman at voidspace.org.uk> wrote:
> On 11/08/2010 14:54, jason pellerin wrote:
>>
>> Sorry I wasn't able to jump back in yesterday, hectic workday.
>>
>> On Tue, Aug 10, 2010 at 2:17 PM, Michael Foord
>> <fuzzyman at voidspace.org.uk>  wrote:
>>
>>>
>>> On 10/08/2010 14:40, Michael Foord wrote:
>>>
>>>>
>>>> On 09/08/2010 17:49, jason pellerin wrote:
>>>>
>>>>>
>>>>> Some questions for nose2-philes.
>>>>>
>>>>> 1) How much do you care about nose-style test discovery? nose does a
>>>>> bunch of extra work to support real-world package layouts, such as
>>>>> prepending ./lib and ./src to sys.path
>>>>>
>>>>
>>>> This you should still be able to do without issue, right?
>>>>
>>>
>>> Ah no, it requires continuing discovery into these directories - with
>>> them
>>> as the top level directory - even though they don't contain an
>>> __init__.py.
>>> I will propose a fix to the TestLoader that allows this to work.
>>>
>>
>> Sounds good. nose's pattern is to actually start discovery in those
>> directories, if they are present, to ensure that if the project layout
>> is something like:
>>
>> lib/mod.py
>> tests/tests.py
>>
>> that mod is importable from tests.
>>
>
> Ok, that sounds straightforward. One question - if there is a lib/ directory
> *and* a src/ directory do you add both to the path and continue discovery
> into both of them - or just the first that you find?
>
> In some ways allowing both is easier. :-)

nose will go into both if it sees both, lib first then src.

> Great. Sounds like a way forward then. I'll implement this in the
> TestLoader, using "test*" as the, pattern for finding top level test
> directories.

Great!

JP



More information about the testing-in-python mailing list