[openstack-dev] How to debug test using pdb

Robert Collins robertc at robertcollins.net
Sun Nov 30 20:27:58 UTC 2014


On 1 December 2014 at 00:08, Saju M <sajuptpm at gmail.com> wrote:
> Hi,
>
> How to debug test using pdb
>
> I want to debug tests and tried following methods, but didn't work
> (could not see pdb> console).
> I could see only the message "Tests running..." and command got stuck.
>
> I tried this with python-neutronclient, that does not have run_test.sh
>
> Method-1:
> #source .tox/py27/bin/activate
> #.tox/py27/bin/python -m testtools.run
> neutronclient.tests.unit.test_cli20_network.CLITestV20NetworkJSON.test_create_network
>
> Method-2:
> #testr list-tests '(CLITestV20NetworkJSON.test_create_network)' > my-list
> #python -m testtools.run discover --load-list my-list


RIght - testr owns stdin and stdout on the test processes; which is
very much needed for paralllel backends. Single-threaded testing it
could potentially just pass them through, and in principle
multiplexing is possible for multiple backends, but thats not
implemented yet.

-Rob

-- 
Robert Collins <rbtcollins at hp.com>
Distinguished Technologist
HP Converged Cloud



More information about the OpenStack-dev mailing list