我刚开始为金字塔网络应用程序准备测试环境并开始运行。我只有一些基本测试,包括一些由金字塔粘贴模板创建的示例。如果我通过nosetest
运行它们,一切正常。在
如果我通过sniffer运行它们,第一次运行也可以。但是,如果我更改代码,并且sniffer再次运行测试,我将得到以下堆栈跟踪:
======================================================================
ERROR: Failure: TypeError (isinstance() arg 2 must be a class, type, or tuple of classes and types)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/domma/Develop/WebApps/Gligg/gligg_env/lib/python2.7/site-packages/nose/loader.py", line 390, in loadTestsFromName
addr.filename, addr.module)
File "/Users/domma/Develop/WebApps/Gligg/gligg_env/lib/python2.7/site-packages/nose/importer.py", line 39, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/Users/domma/Develop/WebApps/Gligg/gligg_env/lib/python2.7/site-packages/nose/importer.py", line 86, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/Users/domma/Develop/WebApps/Gligg/Gligg/gligg/__init__.py", line 1, in <module>
from pyramid.config import Configurator
File "/Users/domma/Develop/WebApps/Gligg/gligg_env/lib/python2.7/site-packages/pyramid/__init__.py", line 1, in <module>
from pyramid.request import Request
File "/Users/domma/Develop/WebApps/Gligg/gligg_env/lib/python2.7/site-packages/pyramid/request.py", line 27, in <module>
from pyramid.response import Response
File "/Users/domma/Develop/WebApps/Gligg/gligg_env/lib/python2.7/site-packages/pyramid/response.py", line 28, in <module>
class Response(_Response):
File "/Users/domma/Develop/WebApps/Gligg/gligg_env/lib/python2.7/site-packages/zope/interface/declarations.py", line 306, in __call__
classImplements(ob, *self.interfaces)
File "/Users/domma/Develop/WebApps/Gligg/gligg_env/lib/python2.7/site-packages/zope/interface/declarations.py", line 244, in classImplements
spec = implementedBy(cls)
File "/Users/domma/Develop/WebApps/Gligg/gligg_env/lib/python2.7/site-packages/zope/interface/declarations.py", line 169, in implementedByFallback
if isinstance(spec, Implements):
TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types
----------------------------------------------------------------------
在我的设置中,我有:
^{pr2}$在我的眼泪里:
DBSession.remove()
testing.tearDown()
在导入Configurator
时已经发生错误,所以我想我错过了一些重置内部的清理代码。但我不知道会是什么。任何暗示都是非常欢迎的!在
这听起来像是sniffer中的一些奇怪的行为,它没有在运行之间正确地重新加载应用程序。你的teardown代码看起来不错,应该关闭当前线程中未完成的数据库连接,并弹出Pyramid使用的任何threadlocal。在
相关问题 更多 >
编程相关推荐