summaryrefslogtreecommitdiff
path: root/functional_tests/test_result.py
blob: 72060202e26f883ac1a116def11458524781ea69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import os
import sys
import unittest
from cStringIO import StringIO
from nose.config import Config
from nose.core import TestProgram
from nose.plugins.manager import PluginManager


support = os.path.join(os.path.dirname(__file__), 'support')

class TestResultSummary(unittest.TestCase):

    def test_with_todo_plugin(self):
        pkpath = os.path.join(support, 'todo')
        sys.path.insert(0, pkpath)
        from todoplug import TodoPlugin

        stream = StringIO()
        config = Config(stream=stream,
                        plugins=PluginManager([TodoPlugin()]))
        
        TestProgram(argv=['t', '--with-todo', pkpath],
                    config=config, exit=False)
        out = stream.getvalue()
        print out
        self.assert_('FAILED (TODO=1)' in out)


if __name__ == '__main__':
    unittest.main()