[copr] bkabrda-workspace: Only drop data, not tables during tests, to speed them up (783c5a8)

bkabrda at fedoraproject.org bkabrda at fedoraproject.org
Tue Nov 20 11:30:49 UTC 2012


Repository : http://git.fedorahosted.org/cgit/copr.git

On branch  : bkabrda-workspace

>---------------------------------------------------------------

commit 783c5a85e64df90689cf3de55bc6ce7297f9728b
Author: Bohuslav Kabrda <bkabrda at redhat.com>
Date:   Tue Nov 20 12:30:30 2012 +0100

    Only drop data, not tables during tests, to speed them up


>---------------------------------------------------------------

 wsgi/tests/coprs_test_case.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/wsgi/tests/coprs_test_case.py b/wsgi/tests/coprs_test_case.py
index 943c4b9..2f8f304 100644
--- a/wsgi/tests/coprs_test_case.py
+++ b/wsgi/tests/coprs_test_case.py
@@ -21,7 +21,9 @@ class CoprsTestCase(object):
         coprs.db.create_all()
 
     def teardown_method(self, method):
-        coprs.db.drop_all()
+        # delete just data, not the tables
+        for tbl in reversed(self.db.metadata.sorted_tables):
+            self.db.engine.execute(tbl.delete())
 
     @pytest.fixture
     def f_data1(self):



More information about the copr-devel mailing list