summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-11-14 18:46:31 (GMT)
committerÉric Araujo <merwok@netwok.org>2011-11-14 18:46:31 (GMT)
commit36500344b293748177a0c6b5a0df187a15063d12 (patch)
treea757a1192966c4d5f463c93a32a3b2bcdf0fe321
parentacc0952ff841941fa289a759414af20c04810311 (diff)
downloadcpython-36500344b293748177a0c6b5a0df187a15063d12.zip
cpython-36500344b293748177a0c6b5a0df187a15063d12.tar.gz
cpython-36500344b293748177a0c6b5a0df187a15063d12.tar.bz2
Remove redundant setUp/tearDown methods in packaging tests
-rw-r--r--Lib/packaging/tests/test_manifest.py8
-rw-r--r--Lib/packaging/tests/test_uninstall.py9
-rw-r--r--Lib/packaging/tests/test_util.py8
3 files changed, 2 insertions, 23 deletions
diff --git a/Lib/packaging/tests/test_manifest.py b/Lib/packaging/tests/test_manifest.py
index 5f89331..f768c47 100644
--- a/Lib/packaging/tests/test_manifest.py
+++ b/Lib/packaging/tests/test_manifest.py
@@ -27,14 +27,6 @@ class ManifestTestCase(support.TempdirManager,
support.LoggingCatcher,
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):
self.assertEqual(self.get_logs(), [])
diff --git a/Lib/packaging/tests/test_uninstall.py b/Lib/packaging/tests/test_uninstall.py
index 9e03b54..b0d9ba7 100644
--- a/Lib/packaging/tests/test_uninstall.py
+++ b/Lib/packaging/tests/test_uninstall.py
@@ -31,14 +31,9 @@ class UninstallTestCase(support.TempdirManager,
def setUp(self):
super(UninstallTestCase, self).setUp()
self.addCleanup(enable_cache)
- self.root_dir = self.mkdtemp()
- self.cwd = os.getcwd()
+ self.addCleanup(packaging.util._path_created.clear)
disable_cache()
- def tearDown(self):
- packaging.util._path_created.clear()
- super(UninstallTestCase, self).tearDown()
-
def get_path(self, dist, name):
# the dist argument must contain an install_dist command correctly
# initialized with a prefix option and finalized befored this method
@@ -79,7 +74,7 @@ class UninstallTestCase(support.TempdirManager,
dist.parse_config_files()
dist.finalize_options()
dist.run_command('install_dist',
- {'prefix': ('command line', self.root_dir)})
+ {'prefix': ('command line', self.mkdtemp())})
site_packages = self.get_path(dist, 'purelib')
return dist, site_packages
diff --git a/Lib/packaging/tests/test_util.py b/Lib/packaging/tests/test_util.py
index 262fef4..737503e 100644
--- a/Lib/packaging/tests/test_util.py
+++ b/Lib/packaging/tests/test_util.py
@@ -602,14 +602,6 @@ class GlobTestCaseBase(support.TempdirManager,
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):
tempdir = self.build_files_tree(spec)
expected = self.clean_tree(spec)