Skip to content

Commit

Permalink
remove explicit test_suite functions
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed Apr 7, 2012
1 parent abad1fb commit ee7b804
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 48 deletions.
8 changes: 0 additions & 8 deletions src/Products/ZCatalog/tests/test_brains.py
Expand Up @@ -10,8 +10,6 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Unittests for Catalog brains
"""

import unittest

Expand Down Expand Up @@ -198,9 +196,3 @@ def testGetObjectRaisesNotFoundForMissing(self):
self.assertEqual(b.getPath(), '/zonked')
self.assertRaises(AttributeError, self.cat.getobject, 3)
self.assertRaises((NotFound, AttributeError, KeyError), b.getObject)


def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestBrains))
return suite
15 changes: 0 additions & 15 deletions src/Products/ZCatalog/tests/test_catalog.py
Expand Up @@ -10,8 +10,6 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
""" Unittests for Catalog.
"""

import unittest
from Testing.ZopeTestCase.warnhook import WarningsHook
Expand Down Expand Up @@ -823,16 +821,3 @@ def test_combined_scored_search(self):
brains = cat(title='1*', true=True)
self.assertEqual(len(brains), 4)
self.assertEqual(brains[0].title, '111')


def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestAddDelColumn))
suite.addTest(unittest.makeSuite(TestAddDelIndexes))
suite.addTest(unittest.makeSuite(TestCatalog))
suite.addTest(unittest.makeSuite(TestRangeSearch))
suite.addTest(unittest.makeSuite(TestCatalogReturnAll))
suite.addTest(unittest.makeSuite(TestCatalogSearchArgumentsMap))
suite.addTest(unittest.makeSuite(TestMergeResults))
suite.addTest(unittest.makeSuite(TestScoring))
return suite
18 changes: 3 additions & 15 deletions src/Products/ZCatalog/tests/test_lazy.py
Expand Up @@ -10,13 +10,11 @@
# FOR A PARTICULAR PURPOSE
#
##############################################################################
"""Unittests for Lazy sequence classes
"""

import unittest


class BaseSequenceTest(unittest.TestCase):
class BaseSequenceTest(object):

def _compare(self, lseq, seq):
self.assertEqual(len(lseq), len(seq))
Expand All @@ -32,7 +30,7 @@ def test_actual_result_count(self):
self.assertEqual(lcat.actual_result_count, 20)


class TestLazyCat(BaseSequenceTest):
class TestLazyCat(unittest.TestCase, BaseSequenceTest):

def _createLSeq(self, *sequences):
from Products.ZCatalog.Lazy import LazyCat
Expand Down Expand Up @@ -262,7 +260,7 @@ def filter(x):
self.assertEqual(len(lmop), letter_length)


class TestLazyValues(BaseSequenceTest):
class TestLazyValues(unittest.TestCase, BaseSequenceTest):

def _createLSeq(self, seq):
from Products.ZCatalog.Lazy import LazyValues
Expand All @@ -283,13 +281,3 @@ def test_slicing(self):
seq = zip(letters, range(10))
lvals = self._createLSeq(seq)
self._compare(lvals[2:-2], range(2, 8))


def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestLazyCat))
suite.addTest(unittest.makeSuite(TestLazyMap))
suite.addTest(unittest.makeSuite(TestLazyFilter))
suite.addTest(unittest.makeSuite(TestLazyMop))
suite.addTest(unittest.makeSuite(TestLazyValues))
return suite
10 changes: 0 additions & 10 deletions src/Products/ZCatalog/tests/test_zcatalog.py
Expand Up @@ -10,8 +10,6 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
""" Unittests for ZCatalog
"""

import unittest

Expand Down Expand Up @@ -432,11 +430,3 @@ def test_unrestrictedGetObject_missing_raises_NotFound(self):
del root.ob
self.assertRaises((NotFound, AttributeError, KeyError),
brain._unrestrictedGetObject)


def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestZCatalog))
suite.addTest(unittest.makeSuite(TestAddDelColumnIndex))
suite.addTest(unittest.makeSuite(TestZCatalogGetObject))
return suite

0 comments on commit ee7b804

Please sign in to comment.