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