← Back to team overview

yahoo-eng-team team mailing list archive

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

 

Public bug reported:

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

** Affects: neutron
     Importance: Undecided
     Assignee: Rodolfo Alonso (rodolfo-alonso-hernandez)
         Status: In Progress

** Changed in: neutron
     Assignee: (unassigned) => Rodolfo Alonso (rodolfo-alonso-hernandez)

** Description changed:

  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):
+   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

-- 
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:
  In Progress

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


Follow ups