Did I find the right examples for you? yes no

All Samples(130321)  |  Call(49)  |  Derive(122261)  |  Import(8011)
A class whose instances are single test cases.

By default, the test code itself should be placed in a method named
'runTest'.

If the fixture may be used for many test cases, create as
many test methods as are needed. When instantiating such a TestCase
subclass, specify in the constructor arguments the name of the test method
that the instance is to execute.
(more...)

src/z/o/zope.testrunner-4.4.3/src/zope/testrunner/tests/testrunner-ex/sampletests_buffering.py   zope.testrunner(Download)
class TestSomething1(unittest.TestCase):
 
    layer = Layer1
 
    def test_something(self):
        pass
 
 
class TestSomething2(unittest.TestCase):

src/z/o/zope.testrunner-4.4.3/src/zope/testrunner/tests/testrunner-ex/sampletestsf.py   zope.testrunner(Download)
class TestA(unittest.TestCase):
    def setUp(self):
        global x
        x = 1
    def tearDown(self):
class TestA2(unittest.TestCase):
    level = 2
 
    def setUp(self):
        global x
class TestB(unittest.TestCase):
    def setUp(self):
        global y
        y = 1
    def tearDown(self):
class TestNotMuch(unittest.TestCase):
    def test_1(self):
        pass
    def test_2(self):
        pass
class TestA1(unittest.TestCase, Layered):
 
    def setUp(self):
        global x
        x = 1

src/z/o/zope.testrunner-4.4.3/src/zope/testrunner/tests/testrunner-ex/sample2/sampletests_ntd.py   zope.testrunner(Download)
class TestSomething(unittest.TestCase):
 
    layer = Layer
 
    def test_something(self):

src/z/o/zope.testrunner-4.4.3/src/zope/testrunner/tests/testrunner-ex/sample1/sampletests_ntds.py   zope.testrunner(Download)
class TestSomething(unittest.TestCase):
 
    layer = Layer
 
    def test_something(self):

src/z/o/zope.testrunner-4.4.3/src/zope/testrunner/tests/testrunner-ex/sample1/sampletests_ntd.py   zope.testrunner(Download)
class TestSomething(unittest.TestCase):
 
    layer = Layer
 
    def test_something(self):

src/p/y/PySide-1.2.2/sources/shiboken/tests/samplebinding/enum_test.py   PySide(Download)
class EnumTest(unittest.TestCase):
    '''Test case for Python representation of C++ enums.'''
 
    def testEnumRepr(self):
        enum = SampleNamespace.Option(1)
class OutOfBoundsTest(unittest.TestCase):
    def testValue(self):
        e = MyEvent()
        self.assertEqual(repr(e.eventType()), 'sample.Event.EventType(999)')
 
class EnumOverloadTest(unittest.TestCase):
    '''Test case for overloads involving enums'''
 
    def testWithInt(self):
        '''Overload with Enums and ints with default value'''
class EnumOperators(unittest.TestCase):
    '''Test case for operations on enums'''
 
    def testInequalitySameObject(self):
        self.assertFalse(Event.ANY_EVENT != Event.ANY_EVENT)

src/z/o/zope.testrunner-4.4.3/src/zope/testrunner/tests/testrunner-ex/sample1/sample11/sampletests.py   zope.testrunner(Download)
class TestA(unittest.TestCase):
    def setUp(self):
        global x
        x = 1
    def tearDown(self):
class TestA3(unittest.TestCase):
 
    level = 3
 
    def setUp(self):
class TestB(unittest.TestCase):
    def setUp(self):
        global y
        y = 1
    def tearDown(self):
class TestB2(unittest.TestCase):
    level = 2
 
    def setUp(self):
        global y
class TestNotMuch(unittest.TestCase):
    def test_1(self):
        pass
    def test_2(self):
        pass

src/i/n/inspyred-HEAD/tests/example_tests.py   inspyred(Download)
class ACS_Test(unittest.TestCase):
    def test(self):
        ac = examples.standard.acs_example.main(prng=prng)
        best = max(ac.archive)
        assert 1550 < (1/best.fitness) < 1553
 
class Custom_EC_Test(unittest.TestCase):
class DEA_Test(unittest.TestCase):
    def test(self):
        dea = examples.standard.dea_example.main(prng=prng)
        best = max(dea.population)
        assert best.fitness < 0.3
 
class EDA_Test(unittest.TestCase):
class ES_Test(unittest.TestCase):
    def test(self):
        es = examples.standard.es_example.main(prng=prng)
        best = max(es.population)
        assert best.fitness < 0.044

src/s/h/Shiboken-1.2.2/sources/shiboken/tests/samplebinding/enum_test.py   Shiboken(Download)
class EnumTest(unittest.TestCase):
    '''Test case for Python representation of C++ enums.'''
 
    def testEnumRepr(self):
        enum = SampleNamespace.Option(1)
class OutOfBoundsTest(unittest.TestCase):
    def testValue(self):
        e = MyEvent()
        self.assertEqual(repr(e.eventType()), 'sample.Event.EventType(999)')
 
class EnumOverloadTest(unittest.TestCase):
    '''Test case for overloads involving enums'''
 
    def testWithInt(self):
        '''Overload with Enums and ints with default value'''
class EnumOperators(unittest.TestCase):
    '''Test case for operations on enums'''
 
    def testInequalitySameObject(self):
        self.assertFalse(Event.ANY_EVENT != Event.ANY_EVENT)

src/z/o/zope.testrunner-4.4.3/src/zope/testrunner/tests/testrunner-ex/sample2/sampletests/test_1.py   zope.testrunner(Download)
class TestA(unittest.TestCase):
    def setUp(self):
        global x
        x = 1
    def tearDown(self):
class TestB(unittest.TestCase):
    def setUp(self):
        global y
        y = 1
    def tearDown(self):
class TestNotMuch(unittest.TestCase):
    def test_1(self):
        pass
    def test_2(self):
        pass

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next