summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mailman/docs/CONTRIBUTE.rst3
-rw-r--r--src/mailman/testing/layers.py12
2 files changed, 9 insertions, 6 deletions
diff --git a/src/mailman/docs/CONTRIBUTE.rst b/src/mailman/docs/CONTRIBUTE.rst
index f1d540f33..f0e273b59 100644
--- a/src/mailman/docs/CONTRIBUTE.rst
+++ b/src/mailman/docs/CONTRIBUTE.rst
@@ -174,8 +174,7 @@ defines these basic overrides in ``src/mailman/config/mailman.cfg``. Your own
configuration file will override those.
By default, all runtime files are put under a ``var`` directory in the current
-working directory. **Be careful though because running the test suite will
-blow this directory away.**
+working directory.
Mailman searches for its configuration file using the following search path.
The first existing file found wins.
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