def test_pkg_info_for_wrong_dist_version(self, deps_mocker_stopall):
# mock
mock_get_distribution = deps_mocker_stopall.MagicMock(name="mock_get_distribution")
# patch
deps_mocker_stopall.patch.object(pkg_resources, 'get_distribution', mock_get_distribution)
mock_get_distribution.side_effect = pkg_resources.VersionConflict
result = deps.pkg_info()
assert PROJECT_NAME == result['name']
assert 'version' not in result
assert 'path' not in result
评论列表
文章目录