[TIP] unittestgui (was: Green and Red bars)

Mark Roddy markroddy at gmail.com
Fri Oct 29 22:30:36 PDT 2010


On Fri, Oct 29, 2010 at 11:31 PM, Michael Foord
<fuzzyman at voidspace.org.uk> wrote:
> On 29/10/2010 23:01, Mark Roddy wrote:
>>
>> On Fri, Oct 29, 2010 at 10:59 PM, Michael Foord
>> <fuzzyman at voidspace.org.uk>  wrote:
>>>
>>> On 29/10/2010 22:51, Mark Roddy wrote:
>>>>
>>>> On Fri, Oct 29, 2010 at 9:48 PM, Michael Foord
>>>> <fuzzyman at voidspace.org.uk>    wrote:
>>>>>
>>>>> On 27/10/2010 21:33, Mark Roddy wrote:
>>>>>>
>>>>>> [snip..]
>>>>>> I've added the last two of Michael's feature requests (fix window
>>>>>> resizing issue and ability to set advanced discovery options).
>>>>>> They're in my bitbucket repo now:
>>>>>> https://bitbucket.org/markroddy/unittestgui
>>>>>>
>>>>>> Questions/comments/feedback are welcome and appreciated.
>>>>>
>>>>> Hey Mark,
>>>>>
>>>>> I'm currently away but due back home soon. I couldn't get the new
>>>>> version
>>>>> of
>>>>> unittestgui to run the mock tests on this laptop. The error I'm getting
>>>>> is:
>>>>>
>>>>>    raise ImportError('Start directory is not importable: %r' %
>>>>> start_dir)
>>>>> ImportError: Start directory is not importable:
>>>>> '/Users/michael/Dev/Packages/mock'
>>>>>
>>>>> Is the top level directory defaulting to the current working directory?
>>>>> It
>>>>> should default to the same directory as the start directory *unless* a
>>>>> start
>>>>> directory has been selected. I can look at this more when I return.
>>>>>
>>>>> It would be nice to be able to pick a top level directory with a
>>>>> directory
>>>>> picker too (but just put it in the text box - being able to edit the
>>>>> directory is useful).
>>>>>
>>>>> All the best,
>>>>>
>>>>> Michael
>>>>>
>>>>>> -Mark
>>>>>
>>>>> --
>>>>> http://www.voidspace.org.uk/
>>>>>
>>>>>
>>>> Michael,
>>>> I was passing in an empty string for the top_level_directory when one
>>>> has not been specified instead of a None value which the discover()
>>>> function explicitly checks for.  I've pushed an update to make sure
>>>> None is passed in in this case and also added a directory dialog for
>>>> selecting the top level directory.  Please let me know if you are
>>>> still experiencing the bug.  I was able to reproduce it on my end, and
>>>> it does not appear to still be an issue.
>>>>
>>> Now it works great the first time, but if I then choose a *different*
>>> directory and click start it fails with the same error as before. Some
>>> state
>>> is obviously hanging around between test runs.
>>>
>>> Thanks for the quick response!
>>>
>>> All the best,
>>>
>>> Michael
>>>
>>>> -Mark
>>>
>> When you select a different directory to discover from or a different
>> top level directory?
>
> Select a different directory to discover from.
>
> Michael
>
>> -Mark
>
>
> --
> http://www.voidspace.org.uk/
>
>

You're getting the same error as before:
ImportError: Start directory is not importable

when you select a different directory to run tests?

I can't seem to reproduce this on my end, but I did find another
issued that occurred when running tests a second time.  I just pushed
a fix for this.  I suspect this may solve the issue you're
experiencing as well as it was based on lingering state of the
previous test run (the imports performed during test discovery were
not being properly undone).

-Mark



More information about the testing-in-python mailing list