Commit b88f9541 authored by Hanno Schlichting's avatar Hanno Schlichting

Some cleanup and provide an explicit test_suite function, the automatic...

Some cleanup and provide an explicit test_suite function, the automatic discovery and ZopeTestCase don't seem to like each other
parent 226712e2
...@@ -15,10 +15,6 @@ ...@@ -15,10 +15,6 @@
""" """
import unittest import unittest
import Testing
#import Zope2
#Zope2.startup()
from Testing.ZopeTestCase.layer import ZopeLite from Testing.ZopeTestCase.layer import ZopeLite
...@@ -109,6 +105,3 @@ def test_suite(): ...@@ -109,6 +105,3 @@ def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(SetConfigTests)) suite.addTest(unittest.makeSuite(SetConfigTests))
return suite return suite
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
...@@ -12,9 +12,7 @@ ...@@ -12,9 +12,7 @@
# #
############################################################################## ##############################################################################
import sys
import unittest import unittest
import logging
import transaction import transaction
class DoomedTransactionInManagerTest(unittest.TestCase): class DoomedTransactionInManagerTest(unittest.TestCase):
...@@ -33,11 +31,8 @@ class DoomedTransactionInManagerTest(unittest.TestCase): ...@@ -33,11 +31,8 @@ class DoomedTransactionInManagerTest(unittest.TestCase):
trans = transaction.get() trans = transaction.get()
trans.doom() trans.doom()
tm.commit() tm.commit()
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(DoomedTransactionInManagerTest)) suite.addTest(unittest.makeSuite(DoomedTransactionInManagerTest))
return suite return suite
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
############################################################################## ##############################################################################
import logging import logging
import unittest
from Testing.ZopeTestCase import ZopeTestCase from Testing.ZopeTestCase import ZopeTestCase
...@@ -61,3 +62,9 @@ class StartupTests(ZopeTestCase): ...@@ -61,3 +62,9 @@ class StartupTests(ZopeTestCase):
provideHandler(logevent, [IDatabaseOpened]) provideHandler(logevent, [IDatabaseOpened])
startup() startup()
self.assertEqual(str(handler), logged) self.assertEqual(str(handler), logged)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(StartupTests))
return suite
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment