1import __future__ 2import unittest 3 4class 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 21if __name__ == '__main__': 22 unittest.main() 23