我从其存储库中克隆了thefuck源代码。尝试通过以下命令将其安装以进行开发:
pip install -r requirements.txt
python setup.py develop
Run Code Online (Sandbox Code Playgroud)
工作正常。之后尝试通过以下方式运行测试:
py.test
Run Code Online (Sandbox Code Playgroud)
出现以下错误:
================================== FAILURES ===================================
_______________________________ test_load_rule ________________________________
mocker = <pytest_mock.MockFixture object at 0x03275A10>
def test_load_rule(mocker):
match = object()
get_new_command = object()
load_source = mocker.patch(
'thefuck.main.load_source',
return_value=Mock(match=match,
get_new_command=get_new_command,
enabled_by_default=True,
priority=900))
assert main.load_rule(Path('/rules/bash.py')) \
== Rule('bash', match, get_new_command, priority=900)
> load_source.assert_called_once_with('bash', '/rules/bash.py')
tests\test_main.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ …Run Code Online (Sandbox Code Playgroud) python ×1