Skip to content

Commit

Permalink
fixes #14.
Browse files Browse the repository at this point in the history
  • Loading branch information
toumorokoshi committed Aug 10, 2016
1 parent fbbe110 commit 6a6e831
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,4 @@ include/
.eggs/
lib/
.pydistutils.cfg
.coverage*
15 changes: 15 additions & 0 deletions tests/test_packages_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ def test_install(tmpdir):
assert code == 0


def test_package_cache(tmpdir):
""" don't event attempt to call pip, if a package already exists. """
tmpdir.join("ubuild.py").write(URANIUM_PY)
execute_script(
"uranium_standalone", "--uranium-dir", URANIUM_SOURCE_ROOT,
cwd=tmpdir.strpath
)
code, out, err = execute_script(
"uranium_standalone", "--uranium-dir", URANIUM_SOURCE_ROOT,
cwd=tmpdir.strpath
)
assert "Requirement already satisified" not in str(out)
assert code == 0


def test_update(tmpdir):
""" update should update versions to the latest. """
hard_version = URANIUM_PY_UPDATE.format(',version="==1.3.1"')
Expand Down
3 changes: 1 addition & 2 deletions uranium/packages/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def _is_package_already_installed(name, version):
package_name += version
pkg_resources.get_distribution(package_name)
return True
except (pkg_resources.VersionConflict,
pkg_resources.DistributionNotFound):
except Exception:
pass
return False

0 comments on commit 6a6e831

Please sign in to comment.