Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #49449

Unittest fails to import module

From Martin Schöön <martin.schoon@gmail.com>
Newsgroups comp.lang.python
Subject Unittest fails to import module
Date 2013-06-29 19:13 +0000
Organization @ Home
Message-ID <b38pvbFjlv9U1@mid.individual.net> (permalink)

Show all headers | View raw


I know the answer to this must be trivial but I am stuck...

I am starting on a not too complex Python project. Right now the
project file structure contains three subdirectories and two
files with Python code:

code
   blablabla.py
test
   blablabla_test.py
doc
   (empty for now)

blablabla_test.py contains "import unittest" and "import blablabla"

$PYTHONPATH points at both the code and the test directories.

When I run blablabla_test.py it fails to import blablabla.py

I have messed around for oven an hour and get nowhere. I have
done unittesting like this with success in the past and I have
revisited one of those projects and it still works there.

The older project has a slightly flatter structure as it lacks
a separate code subdirectory:

something.py
test
   something_test.py

I have temporarily tried this on the new project but to no avail.

Any leads?

TIA

/Martin

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Unittest fails to import module Martin Schöön <martin.schoon@gmail.com> - 2013-06-29 19:13 +0000
  Re: Unittest fails to import module Roy Smith <roy@panix.com> - 2013-06-29 15:25 -0400
  Re: Unittest fails to import module Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-29 19:26 +0000
    Re: Unittest fails to import module Martin Schöön <martin.schoon@gmail.com> - 2013-06-29 21:19 +0000

csiph-web