/Lib/test/test_future5.py

http://unladen-swallow.googlecode.com/ · Python · 21 lines · 13 code · 7 blank · 1 comment · 1 complexity · 3e3ce1e1889fd612c11f24c3fe758df5 MD5 · raw file

  1. # Check that multiple features can be enabled.
  2. from __future__ import unicode_literals, print_function
  3. import sys
  4. import unittest
  5. from . import test_support
  6. class TestMultipleFeatures(unittest.TestCase):
  7. def test_unicode_literals(self):
  8. self.assertTrue(isinstance("", unicode))
  9. def test_print_function(self):
  10. with test_support.captured_output("stderr") as s:
  11. print("foo", file=sys.stderr)
  12. self.assertEqual(s.getvalue(), "foo\n")
  13. def test_main():
  14. test_support.run_unittest(TestMultipleFeatures)