<div dir="ltr">Hi,<div><br></div><div>Ensure that stdout isn't captured by the corresponding fixture:</div><div><br></div><div><div>OS_STDOUT_CAPTURE=0 python -m testtools.run neutron.tests.unit.openvswitch.test_ovs_neutron_agent.TestOvsNeutronAgent.test_port_update</div>
<div>Tests running...</div><div>> /home/rpodolyaka/src/neutron/neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py(251)test_port_update()</div><div> 250 </div><div>--> 251 with contextlib.nested(</div>
<div> 252 mock.patch.object(self.agent.int_br, "get_vif_port_by_id"),</div><div><br></div><div><br></div><div><div>OS_STDOUT_CAPTURE=1 python -m testtools.run neutron.tests.unit.openvswitch.test_ovs_neutron_agent.TestOvsNeutronAgent.test_port_update</div>
<div>Tests running...</div><div>======================================================================</div><div>ERROR: neutron.tests.unit.openvswitch.test_ovs_neutron_agent.TestOvsNeutronAgent.test_port_update</div><div>
----------------------------------------------------------------------</div><div>Empty attachments:</div><div> pythonlogging:''</div><div> stdout</div><div><br></div><div>Traceback (most recent call last):</div>
<div> File "neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py", line 248, in test_port_update</div><div> import ipdb</div></div><div><br></div><div>(....)</div><div><br></div><div>AttributeError: '_io.BytesIO' object has no attribute 'name'<br>
</div><div><br></div><div style>Thanks,</div><div style>Roman</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 17, 2013 at 5:58 AM, Qiu Yu <span dir="ltr"><<a href="mailto:unicell@gmail.com" target="_blank">unicell@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I'm wondering is there any one ever tried using ipdb in Neutron test<br>
cases? The same trick that used to be working with Nova, cannot be<br>
applied in Neutron.<br>
<br>
For example, you can trigger one specific test case. But once ipdb<br>
line is added, following exception will be raised from ipython.<br>
<br>
Any thoughts? How can I make ipdb work with Neutron test case? Thanks!<br>
<br>
$ source .venv/bin/activate<br>
(.venv)$ python -m testtools.run<br>
quantum.tests.unit.openvswitch.test_ovs_quantum_agent.TestOvsQuantumAgent.test_port_update<br>
<br>
======================================================================<br>
ERROR: quantum.tests.unit.openvswitch.test_ovs_quantum_agent.TestOvsQuantumAgent.test_port_update<br>
----------------------------------------------------------------------<br>
Empty attachments:<br>
pythonlogging:''<br>
stderr<br>
stdout<br>
<br>
Traceback (most recent call last):<br>
File "quantum/tests/unit/openvswitch/test_ovs_quantum_agent.py",<br>
line 163, in test_port_update<br>
from ipdb import set_trace; set_trace()<br>
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/ipdb/__init__.py",<br>
line 16, in <module><br>
from ipdb.__main__ import set_trace, post_mortem, pm, run,<br>
runcall, runeval, launch_ipdb_on_exception<br>
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/ipdb/__main__.py",<br>
line 26, in <module><br>
import IPython<br>
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/IPython/__init__.py",<br>
line 43, in <module><br>
from .config.loader import Config<br>
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/IPython/config/__init__.py",<br>
line 16, in <module><br>
from .application import *<br>
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/IPython/config/application.py",<br>
line 31, in <module><br>
from IPython.config.configurable import SingletonConfigurable<br>
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/IPython/config/configurable.py",<br>
line 26, in <module><br>
from loader import Config<br>
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/IPython/config/loader.py",<br>
line 27, in <module><br>
from IPython.utils.path import filefind, get_ipython_dir<br>
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/IPython/utils/path.py",<br>
line 25, in <module><br>
from IPython.utils.process import system<br>
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/IPython/utils/process.py",<br>
line 27, in <module><br>
from ._process_posix import _find_cmd, system, getoutput, arg_split<br>
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/IPython/utils/_process_posix.py",<br>
line 27, in <module><br>
from IPython.utils import text<br>
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/IPython/utils/text.py",<br>
line 29, in <module><br>
from <a href="http://IPython.utils.io" target="_blank">IPython.utils.io</a> import nlprint<br>
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/IPython/utils/io.py",<br>
line 78, in <module><br>
stdout = IOStream(sys.stdout, fallback=devnull)<br>
File "/opt/stack/quantum/.venv/local/lib/python2.7/site-packages/IPython/utils/io.py",<br>
line 42, in __init__<br>
setattr(self, meth, getattr(stream, meth))<br>
AttributeError: '_io.BytesIO' object has no attribute 'name'<br>
<br>
<br>
--<br>
Qiu Yu<br>
<br>
_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</blockquote></div><br></div>