failed to run python -m unittest discover tests/unit

Bug #1457162 reported by Sergey Skripnick
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Rally
Fix Released
Medium
Sergey Skripnick

Bug Description

Error when trying to run unittests without tox:

python -m unittest discover tests/unit

...

  File "/usr/lib/python2.7/pdb.py", line 61, in <module>
    class Pdb(bdb.Bdb, cmd.Cmd):
AttributeError: 'module' object has no attribute 'Cmd'

All tests failed.

This is happened because of rally.cmd module.

pdb.py has following line:

 import cmd

and in some cases it imports `rally.cmd` instead of standard python's `cmd` module.

This may cause other unexpected errors.

rally.cmd should be renamed. `cli` seems good name for it

Yair Fried (yfried)
Changed in rally:
importance: Undecided → Medium
Changed in rally:
assignee: nobody → Sergey Skripnick (eyerediskin)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to rally (master)

Reviewed: https://review.openstack.org/184591
Committed: https://git.openstack.org/cgit/openstack/rally/commit/?id=a9b635f62e1666e51d7e0cc9b7f5b77c2788e527
Submitter: Jenkins
Branch: master

commit a9b635f62e1666e51d7e0cc9b7f5b77c2788e527
Author: Sergey Skripnick <email address hidden>
Date: Wed May 20 22:10:22 2015 +0300

    Rename rally.cmd to rally.cli

    There is module 'cmd' in standard library, and unittest's discover
    does modify sys.path when running tests. This cause errors when running
    unit tests in some environments (E.g. pycharm)

    Change-Id: I4fd2d271da1b7fd300fbbeb6107aa958e716fd2b
    Closes-Bug: 1457162

Changed in rally:
status: In Progress → Fix Committed
Changed in rally:
milestone: none → 0.0.5
Changed in rally:
status: Fix Committed → Fix Released
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.