2
Functional tests of plugin apis -- individual plugintester runs for
3
test plugins that implement one or more hooks for testing.
8
from nose.plugins import Plugin, PluginTester
10
support = os.path.join(os.path.dirname(__file__), 'support')
12
class AllFail(Plugin):
13
def prepareTestCase(self, test):
17
def fail(self, result):
18
result.startTest(self.test)
21
assert False, "I want to fail!"
23
result.addFailure(self.test, sys.exc_info())
25
result.stopTest(self.test)
27
class TestPrepareTestCase_MakeAllFail(PluginTester, unittest.TestCase):
28
activate = '--with-allfail'
31
suitepath = os.path.join(support, 'package2')
35
print str(self.output)
37
for line in self.output:
38
if line.startswith('test_pak'):
39
assert line.strip().endswith('FAIL'), \
40
"Expected failure but got: %s" % line.strip()
41
assert not str(self.output).strip().endswith('OK')
44
if __name__ == '__main__':