test_future5.py 543 B

123456789101112131415161718192021
  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.assertIsInstance("", 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)