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