clear test cache before and after each MockPackagesTest (I think Ive got a better way to avoid test fragility but Ill add this for now)
This commit is contained in:
		| @@ -70,4 +70,4 @@ def test(parser, args): | |||||||
|         spack.cache_path = join_path(spack.var_path, "test-cache") |         spack.cache_path = join_path(spack.var_path, "test-cache") | ||||||
|         mkdirp(spack.cache_path) |         mkdirp(spack.cache_path) | ||||||
|         spack.test.run(args.names, outputDir, args.verbose) |         spack.test.run(args.names, outputDir, args.verbose) | ||||||
|         shutil.rmtree(spack.cache_path) |         shutil.rmtree(spack.cache_path, ignore_errors=True) | ||||||
|   | |||||||
| @@ -30,9 +30,6 @@ | |||||||
| from spack.test.mock_repo import MockGitRepo | from spack.test.mock_repo import MockGitRepo | ||||||
| from spack.version import ver | from spack.version import ver | ||||||
|  |  | ||||||
| import shutil |  | ||||||
| import os |  | ||||||
|  |  | ||||||
| class GitFetchTest(MockPackagesTest): | class GitFetchTest(MockPackagesTest): | ||||||
|     """Tests fetching from a dummy git repository.""" |     """Tests fetching from a dummy git repository.""" | ||||||
|  |  | ||||||
| @@ -51,8 +48,6 @@ def tearDown(self): | |||||||
|         """Destroy the stage space used by this test.""" |         """Destroy the stage space used by this test.""" | ||||||
|         super(GitFetchTest, self).tearDown() |         super(GitFetchTest, self).tearDown() | ||||||
|         self.repo.destroy() |         self.repo.destroy() | ||||||
|         for d in os.listdir(spack.cache_path): |  | ||||||
|             shutil.rmtree(os.path.join(spack.cache_path, d)) |  | ||||||
|  |  | ||||||
|     def assert_rev(self, rev): |     def assert_rev(self, rev): | ||||||
|         """Check that the current git revision is equal to the supplied rev.""" |         """Check that the current git revision is equal to the supplied rev.""" | ||||||
|   | |||||||
| @@ -125,9 +125,16 @@ def cleanmock(self): | |||||||
|             pkg.dependencies.update(deps) |             pkg.dependencies.update(deps) | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     def rm_cache(self): | ||||||
|  |         shutil.rmtree(spack.cache_path, ignore_errors=True) | ||||||
|  |  | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|  |         self.rm_cache() | ||||||
|  |         mkdirp(spack.cache_path) | ||||||
|         self.initmock() |         self.initmock() | ||||||
|  |  | ||||||
|  |  | ||||||
|     def tearDown(self): |     def tearDown(self): | ||||||
|  |         self.rm_cache() | ||||||
|         self.cleanmock() |         self.cleanmock() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Peter Scheibel
					Peter Scheibel