Mercurial > p > roundup > code
diff test/test_indexer.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 | 3ff1a288fb9c |
| children | 380d8d8b30a3 |
line wrap: on
line diff
--- a/test/test_indexer.py Tue Jan 12 04:33:53 2016 +0300 +++ b/test/test_indexer.py Thu Aug 20 14:44:49 2015 +1000 @@ -149,7 +149,8 @@ def tearDown(self): shutil.rmtree('test-index') -class RDBMSIndexerTest(IndexerTest): + +class RDBMSIndexerTest(object): def setUp(self): # remove previous test, ignore errors if os.path.exists(config.DATABASE): @@ -162,7 +163,8 @@ if os.path.exists(config.DATABASE): shutil.rmtree(config.DATABASE) -class postgresqlIndexerTest(postgresqlOpener, RDBMSIndexerTest): + +class postgresqlIndexerTest(postgresqlOpener, RDBMSIndexerTest, IndexerTest): def setUp(self): postgresqlOpener.setUp(self) RDBMSIndexerTest.setUp(self) @@ -170,7 +172,8 @@ RDBMSIndexerTest.tearDown(self) postgresqlOpener.tearDown(self) -class mysqlIndexerTest(mysqlOpener, RDBMSIndexerTest): + +class mysqlIndexerTest(mysqlOpener, RDBMSIndexerTest, IndexerTest): def setUp(self): mysqlOpener.setUp(self) RDBMSIndexerTest.setUp(self) @@ -178,7 +181,8 @@ RDBMSIndexerTest.tearDown(self) mysqlOpener.tearDown(self) -class sqliteIndexerTest(sqliteOpener, RDBMSIndexerTest): + +class sqliteIndexerTest(sqliteOpener, RDBMSIndexerTest, IndexerTest): pass def test_suite():
