← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1805844] Re: When debugging fullstack tests, "cmd" module is incorrectly imported

 

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 <ralonsoh@xxxxxxxxxx>
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

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1805844

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

Status in neutron:
  Fix Released

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1805844/+subscriptions


References