[TIP] Nose Test Discovery - Am I doing it wrong?

Lawrence Oluyede l.oluyede at gmail.com
Tue Dec 2 11:29:48 PST 2008


On Tue, Dec 2, 2008 at 8:21 PM, Casey McGinty <casey.mcginty at gmail.com> wrote:
>
>> nose discovery looks for something resembling a test and that script
>> isn't, but you can force it to be executed using:
>>
>> $ nosetests myscript.py
>>
> Assuming I have a multi-level hierarchy of 100's of python files, all with
> built-in unit tests, what is the easiest way to get nose to find and run all
> of the test cases?
>

project/
  supercoolmodule_1.py
  supercoolmodule_100.py
  tests/
    test_supercoolmodule_1.py
    test_supercoolmodule_100.py

$ cd project
$ nosetests -sv

you'll see each and every testcase in each and avery test_*.py module

-- 
Lawrence, www.neropercaso.it - oluyede.org
"It is difficult to get a man to understand
something when his salary depends on not
understanding it" - Upton Sinclair



More information about the testing-in-python mailing list