Home | History | Annotate | Download | only in test
      1 import __future__
      2 import unittest
      3 
      4 class FLUFLTests(unittest.TestCase):
      5 
      6     def test_barry_as_bdfl(self):
      7         code = "from __future__ import barry_as_FLUFL; 2 {0} 3"
      8         compile(code.format('<>'), '<BDFL test>', 'exec',
      9                 __future__.CO_FUTURE_BARRY_AS_BDFL)
     10         self.assertRaises(SyntaxError, compile, code.format('!='),
     11                             '<FLUFL test>', 'exec',
     12                             __future__.CO_FUTURE_BARRY_AS_BDFL)
     13 
     14     def test_guido_as_bdfl(self):
     15         code = '2 {0} 3'
     16         compile(code.format('!='), '<BDFL test>', 'exec')
     17         self.assertRaises(SyntaxError, compile, code.format('<>'),
     18                             '<FLUFL test>', 'exec')
     19 
     20 
     21 if __name__ == '__main__':
     22     unittest.main()
     23