When debugging fullstack tests, "cmd" module is incorrectly imported

Bug #1805844 reported by Rodolfo Alonso
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Rodolfo Alonso

Bug Description

When fullstack tests are executed manually with a debugger (e.g.: PyCharm integrated debugger), the "cmd" folder is imported instead of "cmd" [1] module.

To solve this problem, this folder and the references to this path must be changed.

Error received when executing manually a fullstack test:
Traceback (most recent call last):
  File "/opt/stack/pycharm-community-2018.2.3/helpers/pycharm/_jb_unittest_runner.py", line 35, in <module>
    main(argv=args, module=None, testRunner=unittestpy.TeamcityTestRunner, buffer=not JB_DISABLE_BUFFERING)
  File "/usr/lib/python2.7/unittest/main.py", line 94, in __init__
    self.parseArgs(argv)
  File "/usr/lib/python2.7/unittest/main.py", line 149, in parseArgs
    self.createTests()
  File "/usr/lib/python2.7/unittest/main.py", line 158, in createTests
    self.module)
  File "/usr/lib/python2.7/unittest/loader.py", line 130, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib/python2.7/unittest/loader.py", line 91, in loadTestsFromName
    module = __import__('.'.join(parts_copy))
  File "/opt/stack/neutron/neutron/tests/fullstack/test_qos.py", line 21, in <module>
    import testscenarios
  File "/usr/local/lib/python2.7/dist-packages/testscenarios/__init__.py", line 58, in <module>
    from testscenarios.scenarios import (
  File "/usr/local/lib/python2.7/dist-packages/testscenarios/scenarios.py", line 33, in <module>
    from testtools.testcase import clone_test_with_new_id
  File "/usr/local/lib/python2.7/dist-packages/testtools/__init__.py", line 61, in <module>
    from testtools.matchers._impl import (
  File "/usr/local/lib/python2.7/dist-packages/testtools/matchers/__init__.py", line 92, in <module>
    from ._doctest import (
  File "/usr/local/lib/python2.7/dist-packages/testtools/matchers/_doctest.py", line 7, in <module>
    import doctest
  File "/usr/lib/python2.7/doctest.py", line 99, in <module>
    import unittest, difflib, pdb, tempfile
  File "/usr/lib/python2.7/pdb.py", line 59, in <module>
    class Pdb(bdb.Bdb, cmd.Cmd):
AttributeError: 'module' object has no attribute 'Cmd'

[1] https://docs.python.org/3/library/cmd.html

Changed in neutron:
assignee: nobody → Rodolfo Alonso (rodolfo-alonso-hernandez)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

Changed in neutron:
status: New → In Progress
Miguel Lavalle (minsel)
Changed in neutron:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/620916
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=b617df2b2158fb3668795d8db9e112b27d083623
Submitter: Zuul
Branch: master

commit b617df2b2158fb3668795d8db9e112b27d083623
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Thu Nov 29 13:55:21 2018 +0000

    Change "cmd" folder in fullstack tests

    When fullstack tests are executed manually using a debugger
    (e.g.: PyCharm integrated debugger), the "cmd" folder is imported
    instead of "cmd" [1] module.

    To solve this problem, this folder and the references to this path
    must be changed.

    [1] https://docs.python.org/3/library/cmd.html

    Change-Id: I8e6b6995c10875a882a46ca3a0d779aafda124a3
    Closes-Bug: #1805844

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 14.0.0.0b1

This issue was fixed in the openstack/neutron 14.0.0.0b1 development milestone.

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.