summaryrefslogtreecommitdiff
path: root/functional_tests/test_success.py
blob: 760a7d1a2da546546e2fa216bce92afdaeb324bf (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
33
34
35
36
37
38
39
40
41
42
43
import os
import unittest
from nose.plugins.plugintest import PluginTester, remove_timings

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


class TestSingleTestPass(PluginTester, unittest.TestCase):
    activate = '-v'
    plugins = []
    suitepath = os.path.join(support, 'pass')

    def test_single_test_pass(self):
        # note that this doesn't use nose.plugins.doctests.run, in order that
        # this test fails if the final terminating newline is not present (it
        # could still be written as a doctest -- PluginTester was just closer
        # to hand)
        print self.output
        output = remove_timings(str(self.output))
        assert output == """\
test.test ... ok

----------------------------------------------------------------------
Ran 1 test in ...s

OK
"""

class TestZeroTestsPass(PluginTester, unittest.TestCase):
    activate = '-v'
    plugins = []
    suitepath = os.path.join(support, 'empty')

    def test_zero_tests_pass(self):
        print self.output
        output = remove_timings(str(self.output))
        assert output == """\

----------------------------------------------------------------------
Ran 0 tests in ...s

OK
"""