0001 from __future__ import nested_scopes 0002 from __future__ import division 0003 0004 import unittest 0005 from test import test_support 0006 0007 x = 2 0008 def nester(): 0009 x = 3 0010 def inner(): 0011 return x 0012 return inner() 0013 0014 0015 class TestFuture(unittest.TestCase): 0016 0017 def test_floor_div_operator(self): 0018 self.assertEqual(7 // 2, 3) 0019 0020 def test_true_div_as_default(self): 0021 self.assertAlmostEqual(7 / 2, 3.5) 0022 0023 def test_nested_scopes(self): 0024 self.assertEqual(nester(), 3) 0025 0026 def test_main(): 0027 test_support.run_unittest(TestFuture) 0028 0029 if __name__ == "__main__": 0030 test_main() 0031
Generated by PyXR 0.9.4