You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
490 B

  1. from __future__ import nested_scopes
  2. from __future__ import division
  3. import unittest
  4. x = 2
  5. def nester():
  6. x = 3
  7. def inner():
  8. return x
  9. return inner()
  10. class TestFuture(unittest.TestCase):
  11. def test_floor_div_operator(self):
  12. self.assertEqual(7 // 2, 3)
  13. def test_true_div_as_default(self):
  14. self.assertAlmostEqual(7 / 2, 3.5)
  15. def test_nested_scopes(self):
  16. self.assertEqual(nester(), 3)
  17. if __name__ == "__main__":
  18. unittest.main()