tox debugging throws AttributeError

Bug #1350424 reported by gordon chung
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Low
gordon chung

Bug Description

the previous solution to debugging ceilometer unittests throws an error now:

======================================================================
ERROR: openstack.common.test (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: openstack.common.test
Traceback (most recent call last):
  File "/usr/lib64/python2.7/unittest/loader.py", line 252, in _find_tests
    module = self._get_module_from_name(name)
  File "/usr/lib64/python2.7/unittest/loader.py", line 230, in _get_module_from_name
    __import__(name)
  File "/opt/stack/ceilometer/ceilometer/openstack/common/test.py", line 33, in <module>
    import fixtures
  File "/opt/stack/ceilometer/.tox/venv/lib/python2.7/site-packages/fixtures/__init__.py", line 68, in <module>
    from fixtures.fixture import (
  File "/opt/stack/ceilometer/.tox/venv/lib/python2.7/site-packages/fixtures/fixture.py", line 26, in <module>
    from testtools.compat import (
  File "/opt/stack/ceilometer/.tox/venv/lib/python2.7/site-packages/testtools/__init__.py", line 59, in <module>
    from testtools.matchers._impl import (
  File "/opt/stack/ceilometer/.tox/venv/lib/python2.7/site-packages/testtools/matchers/__init__.py", line 83, in <module>
    from ._doctest import (
  File "/opt/stack/ceilometer/.tox/venv/lib/python2.7/site-packages/testtools/matchers/_doctest.py", line 7, in <module>
    import doctest
  File "/usr/lib64/python2.7/doctest.py", line 99, in <module>
    import unittest, difflib, pdb, tempfile
  File "/usr/lib64/python2.7/pdb.py", line 59, in <module>
    class Pdb(bdb.Bdb, cmd.Cmd):
AttributeError: 'module' object has no attribute 'Cmd'

we should debugging solution to be inline with suggestion here: https://wiki.openstack.org/wiki/Testr#Debugging_.28pdb.29_Tests

gordon chung (chungg)
Changed in ceilometer:
assignee: nobody → gordon chung (chungg)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

Fix proposed to branch: master
Review: https://review.openstack.org/110707

Changed in ceilometer:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/110707
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=2dc6348c90f3dcf92e1e31e90b23d5fd593da6b0
Submitter: Jenkins
Branch: master

commit 2dc6348c90f3dcf92e1e31e90b23d5fd593da6b0
Author: gordon chung <email address hidden>
Date: Wed Jul 30 12:02:17 2014 -0400

    Debug env for tox

    Running a test with pdb was difficult because tox captures
    output and causes pdb prompt to quit.

    Tips for how to run with debug are provided here:
     https://wiki.openstack.org/wiki/Testr#Debugging_.28pdb.29_Tests

    This change puts these commands into a debug env in tox.ini so
    you can do a command like:

    tox -e debug pycadf.tests.test_cadf_spec

    and when it hits your breakpoint you'll get the debug prompt.

    Change-Id: Ic53a888e4e305d51159d1d6a2f962786a532e089
    Co-Authored-By: Brant Knudson <email address hidden>
    Closes-Bug: #1350424

Changed in ceilometer:
status: In Progress → Fix Committed
Eoghan Glynn (eglynn)
Changed in ceilometer:
milestone: none → juno-3
Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: juno-3 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.