下载Scrapy 0.16的源代码后,我尝试在Macbook上使用./bin/runtests.sh运行测试。令人惊讶的是,测试失败了。它给出了这些结果:FAILED(跳过= 46,失败= 9,成功= 887)。 你们有没有遇到过这个问题?你是如何解决的?
[FAIL]
Traceback (most recent call last):
File "/Users/lws/Downloads/scrapy-scrapy-7b5310d/scrapy/tests/test_utils_queue.py", line 128, in test_close_open
self.assertEqual(q.pop(), 'c')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/trial/unittest.py", line 270, in assertEqual
% (msg, pformat(first), pformat(second)))
twisted.trial.unittest.FailTest: not equal:
a = None
b = 'c'
[FAIL]
Traceback (most recent call last):
File "/Users/lws/Downloads/scrapy-scrapy-7b5310d/scrapy/tests/test_utils_queue.py", line 128, in test_close_open
self.assertEqual(q.pop(), 'c')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/trial/unittest.py", line 270, in assertEqual
% (msg, pformat(first), pformat(second)))
twisted.trial.unittest.FailTest: not equal:
a = 'e'
b = 'c'
答案 0 :(得分:2)
是的,这是scrapy中的一个错误,它似乎没有在GNU / Linux上表现出来,仅在mac os上。这是因为FifoDiskQueue将无缓冲文件读取与缓冲文件搜索混合在一起。
我写了PR来解决这个问题以及其他一些兼容性问题。不确定修复程序何时会进入新版本。
Scrapy确实在mac os上没有问题(FifoDiskQueue是默认情况下不使用的替代队列机制)。