mirror of https://github.com/python/cpython
Fix incorrect test.
The packaging.install.remove function (a.k.a. the uninstall feature) takes a path argument to allow client code to use custom directories instead of sys.path. The test used to give self.root_dir as path, which corresponds to a prefix option, but prefix is not on sys.path, it’s only the base directory used to compute the stdlib and site-packages directory paths. The test now gives a valid site-packages path to the function.
This commit is contained in:
parent
2c30e3999c
commit
9556a5bab2
|
@ -89,9 +89,10 @@ class UninstallTestCase(support.TempdirManager,
|
||||||
site_packages = self.get_path(dist, 'purelib')
|
site_packages = self.get_path(dist, 'purelib')
|
||||||
return dist, site_packages
|
return dist, site_packages
|
||||||
|
|
||||||
def test_uninstall_unknow_distribution(self):
|
def test_uninstall_unknown_distribution(self):
|
||||||
|
dist, site_packages = self.install_dist('Foospam')
|
||||||
self.assertRaises(PackagingError, remove, 'Foo',
|
self.assertRaises(PackagingError, remove, 'Foo',
|
||||||
paths=[self.root_dir])
|
paths=[site_packages])
|
||||||
|
|
||||||
def test_uninstall(self):
|
def test_uninstall(self):
|
||||||
dist, site_packages = self.install_dist()
|
dist, site_packages = self.install_dist()
|
||||||
|
|
Loading…
Reference in New Issue