Kaydet (Commit) 36500344 authored tarafından Éric Araujo's avatar Éric Araujo

Remove redundant setUp/tearDown methods in packaging tests

üst acc0952f
...@@ -27,14 +27,6 @@ class ManifestTestCase(support.TempdirManager, ...@@ -27,14 +27,6 @@ class ManifestTestCase(support.TempdirManager,
support.LoggingCatcher, support.LoggingCatcher,
unittest.TestCase): unittest.TestCase):
def setUp(self):
super(ManifestTestCase, self).setUp()
self.cwd = os.getcwd()
def tearDown(self):
os.chdir(self.cwd)
super(ManifestTestCase, self).tearDown()
def assertNoWarnings(self): def assertNoWarnings(self):
self.assertEqual(self.get_logs(), []) self.assertEqual(self.get_logs(), [])
......
...@@ -31,14 +31,9 @@ class UninstallTestCase(support.TempdirManager, ...@@ -31,14 +31,9 @@ class UninstallTestCase(support.TempdirManager,
def setUp(self): def setUp(self):
super(UninstallTestCase, self).setUp() super(UninstallTestCase, self).setUp()
self.addCleanup(enable_cache) self.addCleanup(enable_cache)
self.root_dir = self.mkdtemp() self.addCleanup(packaging.util._path_created.clear)
self.cwd = os.getcwd()
disable_cache() disable_cache()
def tearDown(self):
packaging.util._path_created.clear()
super(UninstallTestCase, self).tearDown()
def get_path(self, dist, name): def get_path(self, dist, name):
# the dist argument must contain an install_dist command correctly # the dist argument must contain an install_dist command correctly
# initialized with a prefix option and finalized befored this method # initialized with a prefix option and finalized befored this method
...@@ -79,7 +74,7 @@ class UninstallTestCase(support.TempdirManager, ...@@ -79,7 +74,7 @@ class UninstallTestCase(support.TempdirManager,
dist.parse_config_files() dist.parse_config_files()
dist.finalize_options() dist.finalize_options()
dist.run_command('install_dist', dist.run_command('install_dist',
{'prefix': ('command line', self.root_dir)}) {'prefix': ('command line', self.mkdtemp())})
site_packages = self.get_path(dist, 'purelib') site_packages = self.get_path(dist, 'purelib')
return dist, site_packages return dist, site_packages
......
...@@ -602,14 +602,6 @@ class GlobTestCaseBase(support.TempdirManager, ...@@ -602,14 +602,6 @@ class GlobTestCaseBase(support.TempdirManager,
class GlobTestCase(GlobTestCaseBase): class GlobTestCase(GlobTestCaseBase):
def setUp(self):
super(GlobTestCase, self).setUp()
self.cwd = os.getcwd()
def tearDown(self):
os.chdir(self.cwd)
super(GlobTestCase, self).tearDown()
def assertGlobMatch(self, glob, spec): def assertGlobMatch(self, glob, spec):
tempdir = self.build_files_tree(spec) tempdir = self.build_files_tree(spec)
expected = self.clean_tree(spec) expected = self.clean_tree(spec)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment