Brett Cannon | e3944a5 | 2009-04-01 05:08:41 +0000 | [diff] [blame] | 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 | |
Brett Cannon | e3944a5 | 2009-04-01 05:08:41 +0000 | [diff] [blame] | 21 | if __name__ == '__main__': |
Zachary Ware | 38c707e | 2015-04-13 15:00:43 -0500 | [diff] [blame] | 22 | unittest.main() |