1135
1136
# Check if cleanup was called the right number of times.
1136
1137
self.assertEqual(0, test.counter)
1139
def test_not_applicable(self):
1140
# run a test that is skipped because it's not applicable
1141
def not_applicable_test():
1142
from bzrlib.tests import TestNotApplicable
1143
raise TestNotApplicable('this test never runs')
1145
runner = TextTestRunner(stream=out, verbosity=2)
1146
test = unittest.FunctionTestCase(not_applicable_test)
1147
result = self.run_test_runner(runner, test)
1148
self._log_file.write(out.getvalue())
1149
self.assertTrue(result.wasSuccessful())
1150
self.assertTrue(result.wasStrictlySuccessful())
1151
self.assertContainsRe(out.getvalue(),
1152
r'(?m)not_applicable_test * N/A')
1153
self.assertContainsRe(out.getvalue(),
1154
r'(?m)^ this test never runs')
1156
def test_not_applicable_demo(self):
1157
# just so you can see it in the test output
1158
raise TestNotApplicable('this test is just a demonstation')
1138
1160
def test_unsupported_features_listed(self):
1139
1161
"""When unsupported features are encountered they are detailed."""
1140
1162
class Feature1(Feature):