Mercurial > p > roundup > code
diff test/test_anydbm.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 | f6e76a03b502 |
| children | 364c54991861 |
line wrap: on
line diff
--- a/test/test_anydbm.py Tue Jan 12 04:33:53 2016 +0300 +++ b/test/test_anydbm.py Thu Aug 20 14:44:49 2015 +1000 @@ -27,23 +27,29 @@ def nuke_database(self): shutil.rmtree(config.DATABASE) -class anydbmDBTest(anydbmOpener, DBTest): + +class anydbmDBTest(anydbmOpener, DBTest, unittest.TestCase): pass -class anydbmROTest(anydbmOpener, ROTest): + +class anydbmROTest(anydbmOpener, ROTest, unittest.TestCase): pass -class anydbmSchemaTest(anydbmOpener, SchemaTest): + +class anydbmSchemaTest(anydbmOpener, SchemaTest, unittest.TestCase): pass -class anydbmClassicInitTest(ClassicInitTest): + +class anydbmClassicInitTest(ClassicInitTest, unittest.TestCase): backend = 'anydbm' -class anydbmHTMLItemTest(HTMLItemTest): + +class anydbmHTMLItemTest(HTMLItemTest, unittest.TestCase): backend = 'anydbm' + from session_common import DBMTest -class anydbmSessionTest(anydbmOpener, DBMTest): +class anydbmSessionTest(anydbmOpener, DBMTest, unittest.TestCase): pass def test_suite():
