blob: 98b5bd6fd18ace00d18d70124df7c275d34a511f [file] [log] [blame]
Brett Cannone3944a52009-04-01 05:08:41 +00001import __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
Brett Cannone3944a52009-04-01 05:08:41 +000021if __name__ == '__main__':
Zachary Ware38c707e2015-04-13 15:00:43 -050022 unittest.main()