Re: [Tutor] import and unittest

2007-01-17 Thread Thomas Coopman
On 1/17/07, Kent Johnson <[EMAIL PROTECTED]> wrote: Thomas Coopman wrote: > When I run One.py from in the directory A, doesn't look python in it's > parent directory when it can't find the module? > And if that's not the case where and what should I add to the sys.path > variable? No, Python wo

Re: [Tutor] import and unittest

2007-01-17 Thread Kent Johnson
Thomas Coopman wrote: > When I run One.py from in the directory A, doesn't look python in it's > parent directory when it can't find the module? > And if that's not the case where and what should I add to the sys.path > variable? No, Python won't look in parent directories for imports. Try runni

Re: [Tutor] import and unittest

2007-01-17 Thread Thomas Coopman
On 1/17/07, Kent Johnson <[EMAIL PROTECTED]> wrote: Thomas Coopman wrote: > Well I don't really > need the circular imports but I would like to know how to do the imports correct. > > Suppose that in the example that I showed only One needs Two. > > So then we have this: > > M/ > __init__.py > A

Re: [Tutor] import and unittest

2007-01-17 Thread Kent Johnson
Thomas Coopman wrote: > Well I don't really > need the circular imports but I would like to know how to do the imports > correct. > > Suppose that in the example that I showed only One needs Two. > > So then we have this: > > M/ > __init__.py > A/ > __init__.py > One.py > B/ > __init__.py > T

Re: [Tutor] import and unittest

2007-01-17 Thread Thomas Coopman
On 1/17/07, Kent Johnson <[EMAIL PROTECTED]> wrote: thomas coopman wrote: > On Tue, 16 Jan 2007 10:06:37 - > "Alan Gauld" <[EMAIL PROTECTED]> wrote: > >> "Thomas Coopman" <[EMAIL PROTECTED]> wrote >> . >>> I wondered if it was possible to do something like this: >>> >>> src/ >>>-a_module

Re: [Tutor] import and unittest

2007-01-17 Thread Kent Johnson
thomas coopman wrote: > On Tue, 16 Jan 2007 10:06:37 - > "Alan Gauld" <[EMAIL PROTECTED]> wrote: > >> "Thomas Coopman" <[EMAIL PROTECTED]> wrote >> . >>> I wondered if it was possible to do something like this: >>> >>> src/ >>>-a_module/ >>>-sub_module/ >>> test/ >>>-a_module/

Re: [Tutor] import and unittest

2007-01-17 Thread thomas coopman
On Tue, 16 Jan 2007 10:06:37 - "Alan Gauld" <[EMAIL PROTECTED]> wrote: > > "Thomas Coopman" <[EMAIL PROTECTED]> wrote > . > > I wondered if it was possible to do something like this: > > > > src/ > >-a_module/ > >-sub_module/ > > test/ > >-a_module/ > >-sub_module/ > >

Re: [Tutor] import and unittest

2007-01-16 Thread Duncan Gibson
> I wondered if it was possible to do something like this: > > src/ >-a_module/ >-sub_module/ > test/ >-a_module/ >-sub_module/ Why not really keep the test code with the main code? # module code here # if __name__ == '__main__': import unittest class TestModul

Re: [Tutor] import and unittest

2007-01-16 Thread Kent Johnson
Thomas Coopman wrote: > Hi, > > the documentation of pyunit > say that it is good to place the unittest in a seperate module. > I wondered if it was possible to do something like this: > > src/ > -a_module/ > -sub_module/ > test/ > -a_module/ > -sub_module/ > > So the te

Re: [Tutor] import and unittest

2007-01-16 Thread thomas coopman
On Tue, 16 Jan 2007 10:06:37 - "Alan Gauld" <[EMAIL PROTECTED]> wrote: > > "Thomas Coopman" <[EMAIL PROTECTED]> wrote > . > > I wondered if it was possible to do something like this: > > > > src/ > >-a_module/ > >-sub_module/ > > test/ > >-a_module/ > >-sub_module/ > >

Re: [Tutor] import and unittest

2007-01-16 Thread Alan Gauld
"Thomas Coopman" <[EMAIL PROTECTED]> wrote . > I wondered if it was possible to do something like this: > > src/ >-a_module/ >-sub_module/ > test/ >-a_module/ >-sub_module/ > I don;t see any reason why not although its slightly more work. Personally I tend to keep the test