test_future5.py 510 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 test import support
  6. class TestMultipleFeatures(unittest.TestCase):
  7. def test_unicode_literals(self):
  8. self.assertIsInstance("", str)
  9. def test_print_function(self):
  10. with support.captured_output("stderr") as s:
  11. print("foo", file=sys.stderr)
  12. self.assertEqual(s.getvalue(), "foo\n")
  13. if __name__ == '__main__':
  14. unittest.main()