diff options
| author | Barry Warsaw | 2016-05-01 17:10:43 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2016-05-01 17:10:43 -0400 |
| commit | dd659b75659f8727425d3102777b850bb32e11be (patch) | |
| tree | 2a3594f74b042967244cefb3115e52e048dd3284 /src/mailman/testing/layers.py | |
| parent | e61e9b73f84c2c0ff646d6967436507692d0220f (diff) | |
| download | mailman-dd659b75659f8727425d3102777b850bb32e11be.tar.gz mailman-dd659b75659f8727425d3102777b850bb32e11be.tar.zst mailman-dd659b75659f8727425d3102777b850bb32e11be.zip | |
Diffstat (limited to 'src/mailman/testing/layers.py')
| -rw-r--r-- | src/mailman/testing/layers.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mailman/testing/layers.py b/src/mailman/testing/layers.py index 3c65d0b2a..a282b2803 100644 --- a/src/mailman/testing/layers.py +++ b/src/mailman/testing/layers.py @@ -185,11 +185,15 @@ class ConfigLayer(MockAndMonkeyLayer): # no data in case the tests are rerun with a database layer like mysql # or postgresql which are not deleted in teardown. shutil.rmtree(cls.var_dir) + # Prevent the bit of post-processing on the .pop() that creates + # directories. We're basically shutting down everything and we don't + # need the directories created. Plus, doing so leaves a var directory + # turd in the source tree's top-level directory. We do it this way + # rather than shutil.rmtree'ing the resulting var directory because + # it's possible the user created a valid such directory for + # operational or test purposes. + config.create_paths = False config.pop('test config') - # Now config.VAR_DIR will point to the current directory's 'var' - # directory, which will have been created in config.pop()'s post - # processing. Clean that up too. - shutil.rmtree(config.VAR_DIR, ignore_errors=True) cls.var_dir = None @classmethod |
