Skip to content

Commit 0663272

Browse files
author
Richard Jones
committed
note on how to fix mysql tests - also indicate which tests are being run
1 parent 4c7bbf6 commit 0663272

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

test/test_db.py

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: test_db.py,v 1.66 2003-01-13 23:32:12 richard Exp $
18+
# $Id: test_db.py,v 1.67 2003-01-14 10:52:05 richard Exp $
1919

2020
import unittest, os, shutil, time
2121

@@ -205,6 +205,10 @@ def testKeyValue(self):
205205
self.db.user.retire(newid)
206206
self.assertRaises(KeyError, self.db.user.lookup, 'spam')
207207

208+
# use the key again now that the old is retired
209+
newid2 = self.db.user.create(username="spam")
210+
self.assertNotEqual(newid, newid2)
211+
208212
def testNewProperty(self):
209213
self.db.issue.create(title="spam", status='1')
210214
self.db.issue.addprop(fixer=Link("user"))
@@ -702,6 +706,13 @@ def setUp(self):
702706
setupSchema(self.db, 0, gadfly)
703707

704708

709+
# XXX to fix the mysql tests...
710+
# From: Andrey Lebedev <[email protected]>
711+
# I believe we can DROP DATABASE <dbname> and then CREATE DATABASE
712+
# <dbname>.. it's an easiest way. This will work if db user has all
713+
# privileges on database.
714+
# Another way - to perform "SHOW TABLES" SQL and then perform DROP TABLE
715+
# <tblname> on each table...
705716
class mysqlDBTestCase(anydbmDBTestCase):
706717
def setUp(self):
707718
from roundup.backends import mysql
@@ -820,31 +831,39 @@ def suite():
820831
# return unittest.TestSuite(l)
821832

822833
from roundup import backends
823-
if hasattr(backends, 'mysql'):
824-
l.append(unittest.makeSuite(mysqlDBTestCase, 'test'))
825-
l.append(unittest.makeSuite(mysqlReadOnlyDBTestCase, 'test'))
834+
p = []
835+
# if hasattr(backends, 'mysql'):
836+
# p.append('mysql')
837+
# l.append(unittest.makeSuite(mysqlDBTestCase, 'test'))
838+
# l.append(unittest.makeSuite(mysqlReadOnlyDBTestCase, 'test'))
826839
# return unittest.TestSuite(l)
827840

828841
if hasattr(backends, 'gadfly'):
842+
p.append('gadfly')
829843
l.append(unittest.makeSuite(gadflyDBTestCase, 'test'))
830844
l.append(unittest.makeSuite(gadflyReadOnlyDBTestCase, 'test'))
831845

832846
if hasattr(backends, 'sqlite'):
847+
p.append('sqlite')
833848
l.append(unittest.makeSuite(sqliteDBTestCase, 'test'))
834849
l.append(unittest.makeSuite(sqliteReadOnlyDBTestCase, 'test'))
835850

836851
if hasattr(backends, 'bsddb'):
852+
p.append('bsddb')
837853
l.append(unittest.makeSuite(bsddbDBTestCase, 'test'))
838854
l.append(unittest.makeSuite(bsddbReadOnlyDBTestCase, 'test'))
839855

840856
if hasattr(backends, 'bsddb3'):
857+
p.append('bsddb3')
841858
l.append(unittest.makeSuite(bsddb3DBTestCase, 'test'))
842859
l.append(unittest.makeSuite(bsddb3ReadOnlyDBTestCase, 'test'))
843860

844861
if hasattr(backends, 'metakit'):
862+
p.append('metakit')
845863
l.append(unittest.makeSuite(metakitDBTestCase, 'test'))
846864
l.append(unittest.makeSuite(metakitReadOnlyDBTestCase, 'test'))
847865

866+
print 'running %s backend tests'%(', '.join(p))
848867
return unittest.TestSuite(l)
849868

850869
# vim: set filetype=python ts=4 sw=4 et si

0 commit comments

Comments
 (0)