PageRenderTime 46ms CodeModel.GetById 38ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/Lib/test/test_future5.py

http://unladen-swallow.googlecode.com/
Python | 21 lines | 16 code | 4 blank | 1 comment | 0 complexity | 3e3ce1e1889fd612c11f24c3fe758df5 MD5 | raw file
 1# Check that multiple features can be enabled.
 2from __future__ import unicode_literals, print_function
 3
 4import sys
 5import unittest
 6from . import test_support
 7
 8
 9class TestMultipleFeatures(unittest.TestCase):
10
11    def test_unicode_literals(self):
12        self.assertTrue(isinstance("", unicode))
13
14    def test_print_function(self):
15        with test_support.captured_output("stderr") as s:
16            print("foo", file=sys.stderr)
17        self.assertEqual(s.getvalue(), "foo\n")
18
19
20def test_main():
21    test_support.run_unittest(TestMultipleFeatures)