Skip to content

Commit

Permalink
Merge pull request #405 from arcivanov/issue_404
Browse files Browse the repository at this point in the history
Wrong dependency version error formatting
  • Loading branch information
arcivanov committed Sep 19, 2016
2 parents 3484502 + 9548461 commit 3884446
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/python/pybuilder/core.py
Expand Up @@ -239,7 +239,7 @@ def __init__(self, name, version=None, url=None):
try:
version = str(SpecifierSet(version))
except InvalidSpecifier:
raise ValueError("'%s' must be either PEP 0440 version or a version specifier set")
raise ValueError("'%s' must be either PEP 0440 version or a version specifier set" % version)

self.version = version
self.url = url
Expand Down
Expand Up @@ -204,6 +204,9 @@ def test_should_install_dependency_with_version_and_operator(self, exec_command,
exec_command(
PIP_EXEC_STANZA + ["install", 'spam==0.1.2'], ANY, env=ANY, shell=False)

def test_should_install_dependency_with_wrong_version_and_operator(self):
self.assertRaises(ValueError, Dependency, "spam", "~=1")

@patch("pybuilder.plugins.python.install_dependencies_plugin.create_constraint_file")
@patch("pybuilder.plugins.python.install_dependencies_plugin.get_package_version", return_value={})
@patch("pybuilder.plugins.python.install_dependencies_plugin.execute_command", return_value=0)
Expand Down

0 comments on commit 3884446

Please sign in to comment.