Permalink
Browse files

use nose.tools.assert_raises

  • Loading branch information...
qwcode committed Jun 26, 2012
1 parent 0e3c03f commit dec32aba0be130547080bbd3ed56b70bfe22c175
Showing with 2 additions and 6 deletions.
  1. +2 −6 tests/test_uninstall.py
View
@@ -3,6 +3,7 @@
from os.path import join, abspath
from tempfile import mkdtemp
from mock import Mock
+from nose.tools import assert_raises
from tests.test_pip import here, reset_env, run_pip, assert_all_changes, write_file, pyversion
from tests.local_repos import local_repo, local_checkout
@@ -166,9 +167,4 @@ def test_uninstallpathset_no_paths():
from pip.exceptions import InstallationError
mock_dist = Mock(project_name='pkg')
uninstall_set = UninstallPathSet(mock_dist)
- try:
- uninstall_set.remove()
- assert False, "Uninstalling with no paths should have thrown InstallationError"
- except InstallationError:
- e = sys.exc_info()[1]
- assert str(e) == "Can't uninstall 'pkg'. No files were found to uninstall.", str(e)
+ assert_raises(InstallationError, uninstall_set.remove)

0 comments on commit dec32ab

Please sign in to comment.