1

nova で単体テストを実行するための仮想環境を作成できました。少なくともそう言った。

Nova development environment setup is complete.
Nova development uses virtualenv to track and manage Python dependencies
while in development and testing.
To activate the Nova virtualenv for the extent of your current shell
session you can run:
.....

しかし、特定の単体テストケースを実行しようとしたとき、たとえば:

./run_tests.sh test_libvirt

それは言って失敗しています:

Running `tools/with_venv.sh python -m nova.openstack.common.lockutils python setup.py testr --testr-args='--subunit --concurrency 0  test_libvirt'`

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/chinmay/nova/nova/openstack/common/lockutils.py", line 29, in <module>
    from oslo.config import cfg
**ImportError: No module named config**
Ran 0 tests in 0.006s
OK

仮想環境が正しく設定されていませんか? env の oslo.config 。私は source .venv/bin/activateそれをやり直しましたが、同じ結果です。

ここで何か不足していますか?

4

1 に答える 1

1

削除oslo.configして、仮想環境に再度インストールしてください。これはあなたの問題を解決するかもしれません:)

于 2014-04-04T08:36:02.037 に答える