1import os
2import sys
3import unittest
4
5from nose.plugins import PluginTester
6from nose.plugins.builtin import Deprecated, Skip
7from nose.plugins.skip import SkipTest
8
9
10support = os.path.join(os.path.dirname(__file__), 'support')
11
12
13class TestStringException(PluginTester, unittest.TestCase):
14    activate = '-v'
15    plugins = [Deprecated(), Skip()]
16    args = []
17    suitepath = os.path.join(support, 'string-exception')
18
19    def test_string_exception_works(self):
20        if sys.version_info >= (2, 6):
21            raise SkipTest("String exceptions are not supported in this "
22                           "version of Python")
23
24        print
25        print '!' * 70
26        print str(self.output)
27        print '!' * 70
28        print
29        assert 'raise "string exception"' in str(self.output)
30        assert 'raise "string exception in setup"' in str(self.output)
31        assert 'raise "string exception in teardown"' in str(self.output)
32        assert 'raise "string exception in test"' in str(self.output)
33