Skip to content

Commit

Permalink
Add test_install_editable_uninstalls_existing
Browse files Browse the repository at this point in the history
  • Loading branch information
msabramo committed Mar 2, 2014
1 parent bfca0f6 commit 3e0d727
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/functional/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,33 @@ def test_install_editable_from_git(script, tmpdir):
result.assert_installed('pip-test-package', with_files=['.git'])


def test_install_editable_uninstalls_existing(data, script, tmpdir):
"""
Test that installing an editable uninstalls a previously installed
non-editable version.
https://github.com/pypa/pip/issues/1548
https://github.com/pypa/pip/pull/1552
"""
to_install = data.packages.join("pip-test-package-0.1.tar.gz")
result = script.pip_install_local(to_install)
assert 'Successfully installed pip-test-package' in result.stdout
result.assert_installed('piptestpackage', editable=False)

result = script.pip(
'install', '-e',
'%s#egg=pip-test-package' %
local_checkout(
'git+http://github.com/pypa/pip-test-package.git',
tmpdir.join("cache"),
),
# @todo: Why do other tests specify `expect_error=True`?

This comment has been minimized.

Copy link
@msabramo

msabramo Mar 2, 2014

Author Contributor

Do I need to specify expect_error=True as well?

I'll remove this once I find out the answer.

This comment has been minimized.

Copy link
@Ivoz

Ivoz Mar 2, 2014

Contributor

You'd have that if you expected the command executed to have an error. It's really what it says on the box.

This comment has been minimized.

Copy link
@qwcode

qwcode Mar 2, 2014

Contributor

some commands give stderr output, but don't return a non-zero code.
expect_error=True is needed for that.

)
result.assert_installed('pip-test-package', with_files=['.git'])
assert 'Found existing installation: pip-test-package 0.1' in result.stdout
assert 'Uninstalling pip-test-package:' in result.stdout
assert 'Successfully uninstalled pip-test-package' in result.stdout


def test_install_editable_from_hg(script, tmpdir):
"""
Test cloning from Mercurial.
Expand Down

0 comments on commit 3e0d727

Please sign in to comment.