diff test/db_test_base.py @ 5033:63c79c0992ae

Update tests to work with py.test py.test searches for any class that looks like a TestCase in the test directory and tries to run them as tests. Some of the classes that inherit TestCase are not meant to be run and are only intended to be "helper classes". Only the tests of the classes that inherit the "helper classes" should be run. If we convert these "helper classes" to be "mixins" py.test should not pick them up.
author John Kristensen <john@jerrykan.com>
date Thu, 20 Aug 2015 14:44:49 +1000
parents a116de39e38c
children 380d8d8b30a3
line wrap: on
line diff
--- a/test/db_test_base.py	Tue Jan 12 04:33:53 2016 +0300
+++ b/test/db_test_base.py	Thu Aug 20 14:44:49 2015 +1000
@@ -121,7 +121,8 @@
     # nosy tests require this
     db.security.addPermissionToRole('User', 'View', 'msg')
 
-class MyTestCase(unittest.TestCase):
+
+class MyTestCase(object):
     def tearDown(self):
         if hasattr(self, 'db'):
             self.db.close()
@@ -2463,7 +2464,7 @@
         ae (result, ['4', '5', '6', '7', '8', '1', '2', '3'])
 
 
-class ClassicInitBase(unittest.TestCase):
+class ClassicInitBase(object):
     count = 0
     db = None
 

Roundup Issue Tracker: http://roundup-tracker.org/