diff options
| author | Barry Warsaw | 2012-07-25 19:10:40 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2012-07-25 19:10:40 -0400 |
| commit | 12b1c4ca12668e6269d367886f8141005ae8c112 (patch) | |
| tree | fd69adbeb8eea065e154391c4107e552fe94532c /src/mailman/database/sqlite.py | |
| parent | 26bd306b3dbca3cda0ba8eb2e34e2b1261902a6e (diff) | |
| download | mailman-12b1c4ca12668e6269d367886f8141005ae8c112.tar.gz mailman-12b1c4ca12668e6269d367886f8141005ae8c112.tar.zst mailman-12b1c4ca12668e6269d367886f8141005ae8c112.zip | |
Add a temporary database factory so we can remove more cruft from the
individual database classes themselves. This does mean that the temporary
factory must know something special about the sqlite and postgresql databases,
but I think that's an acceptable trade-off.
This should make the test code cleaner, and allow me to write better support
for temporary PostgreSQL databases.
Diffstat (limited to 'src/mailman/database/sqlite.py')
| -rw-r--r-- | src/mailman/database/sqlite.py | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/mailman/database/sqlite.py b/src/mailman/database/sqlite.py index fc1037301..199feed9e 100644 --- a/src/mailman/database/sqlite.py +++ b/src/mailman/database/sqlite.py @@ -35,20 +35,6 @@ from mailman.database.base import StormBaseDatabase -class _TestDB: - # For the test suite; bool column values. - TRUE = 1 - FALSE = 0 - - def __init__(self, database, tempdir): - self.database = database - self._tempdir = tempdir - - def cleanup(self): - shutil.rmtree(self._tempdir) - - - class SQLiteDatabase(StormBaseDatabase): """Database class for SQLite.""" @@ -70,13 +56,3 @@ class SQLiteDatabase(StormBaseDatabase): # Ignore errors if fd > 0: os.close(fd) - - @staticmethod - def _make_testdb(): - from mailman.testing.helpers import configuration - tempdir = tempfile.mkdtemp() - url = 'sqlite:///' + os.path.join(tempdir, 'mailman.db') - database = SQLiteDatabase() - with configuration('database', url=url): - database.initialize() - return _TestDB(database, tempdir) |
