【问题标题】:Django Nose Tests Failing - Traceback from Nose CodeDjango Nose 测试失败 - 来自 Nose 代码的追溯
【发布时间】:2014-04-21 23:21:19
【问题描述】:

我无法运行 django 鼻子测试,所有进程都因此回溯而失败:

Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/jeffquinn/Code/Nuna/data-intrawebVE/lib/python2.7/site-packages/nose/plugins/multiprocess.py", line 652, in runner
    keyboardCaught, shouldStop, loaderClass, resultClass, config)
  File "/Users/jeffquinn/Code/Nuna/data-intrawebVE/lib/python2.7/site-packages/nose/plugins/multiprocess.py", line 669, in __runner
    config.plugins.begin()
  File "/Users/jeffquinn/Code/Nuna/data-intrawebVE/lib/python2.7/site-packages/nose/plugins/manager.py", line 99, in __call__
    return self.call(*arg, **kw)
  File "/Users/jeffquinn/Code/Nuna/data-intrawebVE/lib/python2.7/site-packages/nose/plugins/manager.py", line 167, in simple
    result = meth(*arg, **kw)
  File "/Users/jeffquinn/Code/Nuna/data-intrawebVE/lib/python2.7/site-packages/nose/plugins/cover.py", line 156, in begin
    self.coverInstance.exclude('#pragma[: ]+[nN][oO] [cC][oO][vV][eE][rR]')
AttributeError: 'NoneType' object has no attribute 'exclude'

这是来自pip freeze的相关位:

Django==1.5.1
MySQL-python==1.2.5
South==0.7.6
Werkzeug==0.8.3
boto==2.8.0
dj-database-url==0.2.1
django-appconf==0.6
django-compressor==1.2
django-extensions==1.0.3
django-json-field==0.5.5
django-nose==1.1
django-storages==1.1.6
django-waffle==0.9.0
djangorestframework==2.1.17
nose==1.3.1

其他人看到了吗?我在这个拉取请求 (https://github.com/nose-devs/nose/pull/710) 中看到了它,但不清楚解决方案是什么。

【问题讨论】:

    标签: python django nose


    【解决方案1】:

    我刚刚进入了鼻子源代码并注释掉了第 156-158 行。

        #self.coverInstance.exclude('#pragma[: ]+[nN][oO] [cC][oO][vV][eE][rR]')
        #self.coverInstance.load()
        #self.coverInstance.start()
    

    我所有的测试现在都运行良好。 O_o

    【讨论】:

      猜你喜欢
      • 2012-11-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-16
      • 2013-06-18
      • 2014-05-15
      相关资源
      最近更新 更多