[openstack-dev] ipdb debugging in Neutron test cases?
Qiu Yu
unicell at gmail.com
Wed Jul 17 02:58:36 UTC 2013
Hi,
I'm wondering is there any one ever tried using ipdb in Neutron test
cases? The same trick that used to be working with Nova, cannot be
applied in Neutron.
For example, you can trigger one specific test case. But once ipdb
line is added, following exception will be raised from ipython.
Any thoughts? How can I make ipdb work with Neutron test case? Thanks!
$ source .venv/bin/activate
(.venv)$ python -m testtools.run
quantum.tests.unit.openvswitch.test_ovs_quantum_agent.TestOvsQuantumAgent.test_port_update
======================================================================
ERROR: quantum.tests.unit.openvswitch.test_ovs_quantum_agent.TestOvsQuantumAgent.test_port_update
----------------------------------------------------------------------
Empty attachments:
pythonlogging:''
stderr
stdout
Traceback (most recent call last):
File "quantum/tests/unit/openvswitch/test_ovs_quantum_agent.py",
line 163, in test_port_update
from ipdb import set_trace; set_trace()
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/ipdb/__init__.py",
line 16, in <module>
from ipdb.__main__ import set_trace, post_mortem, pm, run,
runcall, runeval, launch_ipdb_on_exception
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/ipdb/__main__.py",
line 26, in <module>
import IPython
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/IPython/__init__.py",
line 43, in <module>
from .config.loader import Config
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/IPython/config/__init__.py",
line 16, in <module>
from .application import *
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/IPython/config/application.py",
line 31, in <module>
from IPython.config.configurable import SingletonConfigurable
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/IPython/config/configurable.py",
line 26, in <module>
from loader import Config
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/IPython/config/loader.py",
line 27, in <module>
from IPython.utils.path import filefind, get_ipython_dir
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/IPython/utils/path.py",
line 25, in <module>
from IPython.utils.process import system
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/IPython/utils/process.py",
line 27, in <module>
from ._process_posix import _find_cmd, system, getoutput, arg_split
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/IPython/utils/_process_posix.py",
line 27, in <module>
from IPython.utils import text
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/IPython/utils/text.py",
line 29, in <module>
from IPython.utils.io import nlprint
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/IPython/utils/io.py",
line 78, in <module>
stdout = IOStream(sys.stdout, fallback=devnull)
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/IPython/utils/io.py",
line 42, in __init__
setattr(self, meth, getattr(stream, meth))
AttributeError: '_io.BytesIO' object has no attribute 'name'
--
Qiu Yu
More information about the OpenStack-dev
mailing list