CKAN tests error: "KeyError: 'tags'"
CKAN tests error: "KeyError: 'tags'"
测试通过 CI,但在本地测试 master 时出现错误:
$ nosetests --ckan --with-pylons=test-core.ini ckan/tests/logic/action/test_get.py -x
No handlers could be found for logger "ckan.lib.uploader"
.../usr/lib/ckan/default/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py:2181: SAWarning: Usage of the 'related attribute set' operation is not currently supported within the execution stage of the flush process. Results may not be consistent. Consider using alternative event listeners or connection-level operations instead.
% method)
........................................................................................................................E
======================================================================
ERROR: ckan.tests.logic.action.test_get.TestTagShow.test_tag_show_for_vocab_tag
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/vagrant/src/ckan/ckan/tests/logic/action/test_get.py", line 1857, in test_tag_show_for_vocab_tag
tag_in_dataset = dataset['tags'][0]
KeyError: 'tags'
----------------------------------------------------------------------
Ran 124 tests in 66.301s
FAILED (errors=1)
我可以通过 运行 这两个测试更快地重新创建它:
nosetests --ckan --with-pylons=test-core.ini ckan/tests/logic/action/test_get.py:TestPackageAutocompleteWithDatasetForm.test_custom_schema_returned ckan/tests/logic/action/test_get.py:TestTagShow.test_tag_show_for_vocab_tag
还有其他人遇到这个问题还是只有我遇到这个问题?有没有人知道如何解决它?
(我的部门是最新的,已完成:pip install -r requirements.txt -r dev-requirements.txt
)
我发现问题是 test_get.py 没有正确清理,因为缺少对拆卸的调用。修复:https://github.com/ckan/ckan/pull/4371
测试通过 CI,但在本地测试 master 时出现错误:
$ nosetests --ckan --with-pylons=test-core.ini ckan/tests/logic/action/test_get.py -x
No handlers could be found for logger "ckan.lib.uploader"
.../usr/lib/ckan/default/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py:2181: SAWarning: Usage of the 'related attribute set' operation is not currently supported within the execution stage of the flush process. Results may not be consistent. Consider using alternative event listeners or connection-level operations instead.
% method)
........................................................................................................................E
======================================================================
ERROR: ckan.tests.logic.action.test_get.TestTagShow.test_tag_show_for_vocab_tag
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/vagrant/src/ckan/ckan/tests/logic/action/test_get.py", line 1857, in test_tag_show_for_vocab_tag
tag_in_dataset = dataset['tags'][0]
KeyError: 'tags'
----------------------------------------------------------------------
Ran 124 tests in 66.301s
FAILED (errors=1)
我可以通过 运行 这两个测试更快地重新创建它:
nosetests --ckan --with-pylons=test-core.ini ckan/tests/logic/action/test_get.py:TestPackageAutocompleteWithDatasetForm.test_custom_schema_returned ckan/tests/logic/action/test_get.py:TestTagShow.test_tag_show_for_vocab_tag
还有其他人遇到这个问题还是只有我遇到这个问题?有没有人知道如何解决它?
(我的部门是最新的,已完成:pip install -r requirements.txt -r dev-requirements.txt
)
我发现问题是 test_get.py 没有正确清理,因为缺少对拆卸的调用。修复:https://github.com/ckan/ckan/pull/4371