无法加载插件计时器

时间:2015-02-13 17:03:57

标签: python nosetests

我设置了一台新机器来运行nosetests和nose-timer插件,我的环境中有其他机器运行它们没有问题。我不记得要做任何特别的事。这与我的路径有关吗?我已将路径设置为

  

C:\ Python27 \; C:\ Python27 \ LIB \站点packges; C:\ Python27 \脚本;

但是在有效的机器上,我只有Path27中的Python27和\ Scripts。

我的鼻子测试版本都是1.3.1但是在工作机器上,鼻子计时器版本是0.3.0而非工作版本是0.4.3

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python27\lib\multiprocessing\forking.py", line 380, in main
    prepare(preparation_data)
  File "C:\Python27\lib\multiprocessing\forking.py", line 488, in prepare
    assert main_name not in sys.modules, main_name
AssertionError: __main__
C:\Python27\lib\site-packages\nose\plugins\manager.py:395: RuntimeWarning: Unable to load plugin nosetimer = nosetimer.plugin:TimerPlugin:
  RuntimeWarning)
Usage: nosetests [options]

nosetests: error: no such option: --with-timer

提前致谢, 鲍里斯

2 个答案:

答案 0 :(得分:2)

我最终降级到鼻子计时器0.3.0,我的测试运行正常。

pip uninstall nose-timer
pip install nose-timer==0.3.0

答案 1 :(得分:0)

这可能是由于轮子的上游点问题:https://github.com/pypa/pip/issues/1891

在没有滚轮的情况下安装nose-timer可以解决此问题:

pip install --no-use-wheel nose-timer