/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: Martin Pool
  • Date: 2009-03-23 07:25:27 UTC
  • mfrom: (4183 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4189.
  • Revision ID: mbp@sourcefrog.net-20090323072527-317my4n8zej1g6v9
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1150
1150
        class SkippedTest(TestCase):
1151
1151
 
1152
1152
            def setUp(self):
 
1153
                TestCase.setUp(self)
1153
1154
                calls.append('setUp')
1154
1155
                self.addCleanup(self.cleanup)
1155
1156
 
1371
1372
        self.assertEqual('Incorrect length: wanted 2, got 3 for [1, 2, 3]',
1372
1373
            exception.args[0])
1373
1374
 
 
1375
    def test_base_setUp_not_called_causes_failure(self):
 
1376
        class TestCaseWithBrokenSetUp(TestCase):
 
1377
            def setUp(self):
 
1378
                pass # does not call TestCase.setUp
 
1379
            def test_foo(self):
 
1380
                pass
 
1381
        test = TestCaseWithBrokenSetUp('test_foo')
 
1382
        result = unittest.TestResult()
 
1383
        test.run(result)
 
1384
        self.assertFalse(result.wasSuccessful())
 
1385
        self.assertEqual(1, result.testsRun)
 
1386
 
 
1387
    def test_base_tearDown_not_called_causes_failure(self):
 
1388
        class TestCaseWithBrokenTearDown(TestCase):
 
1389
            def tearDown(self):
 
1390
                pass # does not call TestCase.tearDown
 
1391
            def test_foo(self):
 
1392
                pass
 
1393
        test = TestCaseWithBrokenTearDown('test_foo')
 
1394
        result = unittest.TestResult()
 
1395
        test.run(result)
 
1396
        self.assertFalse(result.wasSuccessful())
 
1397
        self.assertEqual(1, result.testsRun)
 
1398
 
1374
1399
    def test_debug_flags_sanitised(self):
1375
1400
        """The bzrlib debug flags should be sanitised by setUp."""
1376
1401
        if 'allow_debug' in tests.selftest_debug_flags:
1848
1873
class TestSelftestFiltering(TestCase):
1849
1874
 
1850
1875
    def setUp(self):
 
1876
        TestCase.setUp(self)
1851
1877
        self.suite = TestUtil.TestSuite()
1852
1878
        self.loader = TestUtil.TestLoader()
1853
1879
        self.suite.addTest(self.loader.loadTestsFromModuleNames([