unitests don't run under pdb

Miki miki.tebeka at gmail.com
Wed Feb 20 22:51:49 EST 2008


Hello Amit,

> python testname.py : the unitests runs as usual and I get the
> following results:
> ----------------------------------------------------------------------
> Ran 2 tests in 0.024s
>
> OK
> --------------------------------------------------------------------
>
> However, if I do "python -m pdb testnames.py": I get
> ython -m pdb testnames.py> /s/nd6/amit/pyiglu/testnames.py(1)<module>()
>
> -> import unittest
> (Pdb) c
>
> ----------------------------------------------------------------------
> Ran 0 tests in 0.000s
>
> OK
> -------------------------------------------------------------------
IIRC unittest checks the __main__ module for tests to run. Once you
run python with "-m pdb" the __main__ module is pdb and not your
script.

HTH,
--
Miki <miki.tebeka at gmail.com>
http://pythonwise.blogspot.com



More information about the Python-list mailing list