comparison test/test_memorydb.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 6e3e4f24c753
children 364c54991861
comparison
equal deleted inserted replaced
5032:fc0f7655411b 5033:63c79c0992ae
31 self.db.close() 31 self.db.close()
32 self.nuke_database() 32 self.nuke_database()
33 self.db = self.module.Database(config, 'admin') 33 self.db = self.module.Database(config, 'admin')
34 setupSchema(self.db, 0, self.module) 34 setupSchema(self.db, 0, self.module)
35 35
36 class memorydbDBTest(memorydbOpener, DBTest): 36
37 class memorydbDBTest(memorydbOpener, DBTest, unittest.TestCase):
37 pass 38 pass
38 39
39 class memorydbROTest(memorydbOpener, ROTest): 40
41 class memorydbROTest(memorydbOpener, ROTest, unittest.TestCase):
40 def setUp(self): 42 def setUp(self):
41 self.db = self.module.Database(config) 43 self.db = self.module.Database(config)
42 setupSchema(self.db, 0, self.module) 44 setupSchema(self.db, 0, self.module)
43 45
44 class memorydbSchemaTest(memorydbOpener, SchemaTest): 46
47 class memorydbSchemaTest(memorydbOpener, SchemaTest, unittest.TestCase):
45 pass 48 pass
46 49
50
47 from session_common import DBMTest 51 from session_common import DBMTest
48 class memorydbSessionTest(memorydbOpener, DBMTest): 52 class memorydbSessionTest(memorydbOpener, DBMTest, unittest.TestCase):
49 def setUp(self): 53 def setUp(self):
50 self.db = self.module.Database(config, 'admin') 54 self.db = self.module.Database(config, 'admin')
51 setupSchema(self.db, 1, self.module) 55 setupSchema(self.db, 1, self.module)
52 self.sessions = self.db.sessions 56 self.sessions = self.db.sessions
53 57

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