You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2020/02/22 06:51:02 UTC

[couchdb] branch clean-up-after-mango-tests created (now 3d559eb)

This is an automated email from the ASF dual-hosted git repository.

jaydoane pushed a change to branch clean-up-after-mango-tests
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


      at 3d559eb  Clean up mango test user docs

This branch includes the following new commits:

     new e05e3cd  Clean up mango test dbs
     new 3d559eb  Clean up mango test user docs

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[couchdb] 02/02: Clean up mango test user docs

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jaydoane pushed a commit to branch clean-up-after-mango-tests
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 3d559eb14fd709662d3eb5cda8afe9a45687c3b1
Author: Jay Doane <ja...@apache.org>
AuthorDate: Fri Feb 21 22:46:50 2020 -0800

    Clean up mango test user docs
    
    Tests based on class `UsersDbTests` don't clean up the user docs it
    puts in the `_users` db. This uses the classmethod `tearDownClass` to
    delete those docs.
---
 src/mango/test/mango.py     | 4 ++++
 src/mango/test/user_docs.py | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/src/mango/test/mango.py b/src/mango/test/mango.py
index b871894..7a404e2 100644
--- a/src/mango/test/mango.py
+++ b/src/mango/test/mango.py
@@ -314,6 +314,10 @@ class UsersDbTests(unittest.TestCase):
         klass.db = Database("_users")
         user_docs.setup_users(klass.db)
 
+    @classmethod
+    def tearDownClass(klass):
+        user_docs.teardown_users(klass.db)
+
     def setUp(self):
         self.db = self.__class__.db
 
diff --git a/src/mango/test/user_docs.py b/src/mango/test/user_docs.py
index 6793601..40e9cf9 100644
--- a/src/mango/test/user_docs.py
+++ b/src/mango/test/user_docs.py
@@ -59,6 +59,10 @@ def setup_users(db, **kwargs):
     db.save_docs(copy.deepcopy(USERS_DOCS))
 
 
+def teardown_users(db):
+    [db.delete_doc(doc['_id']) for doc in USERS_DOCS]
+
+
 def setup(db, index_type="view", **kwargs):
     db.recreate()
     if index_type == "view":


[couchdb] 01/02: Clean up mango test dbs

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jaydoane pushed a commit to branch clean-up-after-mango-tests
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit e05e3cdc8d16d88e7c7af8fbcc4b671b81ac2693
Author: Jay Doane <ja...@apache.org>
AuthorDate: Fri Feb 21 13:51:42 2020 -0800

    Clean up mango test dbs
    
    After mango python tests are run, a bunch of dbs are typically left
    around, e.g. `mango_test_048b290b574d4039981893097ab71912`
    
    This deletes those test dbs after they are no longer in use.
---
 src/mango/test/mango.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/mango/test/mango.py b/src/mango/test/mango.py
index 62d6c1b..b871894 100644
--- a/src/mango/test/mango.py
+++ b/src/mango/test/mango.py
@@ -324,6 +324,10 @@ class DbPerClass(unittest.TestCase):
         klass.db = Database(random_db_name())
         klass.db.create(q=1, n=1)
 
+    @classmethod
+    def tearDownClass(klass):
+        klass.db.delete()
+
     def setUp(self):
         self.db = self.__class__.db