summaryrefslogtreecommitdiff
path: root/functional_tests/test_string_exception.py
blob: 396c92a7d727195e157344f4c83295fe4f6c0cbf (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 nose.plugins import PluginTester
from nose.plugins.builtin import Deprecated, Skip
from nose.plugins.skip import SkipTest


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


class TestStringException(PluginTester, unittest.TestCase):
    activate = '-v'
    plugins = [Deprecated(), Skip()]
    args = []
    suitepath = os.path.join(support, 'string-exception')

    def test_string_exception_works(self):
        if sys.version_info >= (2, 6):
            raise SkipTest("String exceptions are not supported in this "
                           "version of Python")

        print
        print '!' * 70
        print str(self.output)
        print '!' * 70
        print
        assert 'raise "string exception"' in str(self.output)
        assert 'raise "string exception in setup"' in str(self.output)
        assert 'raise "string exception in teardown"' in str(self.output)
        assert 'raise "string exception in test"' in str(self.output)