blob: 5a709bc5f5d8cb3c34026c7711d042c9f05b2f00 [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
21def test_main():
22 from test.support import run_unittest
23 run_unittest(FLUFLTests)
24
25
26if __name__ == '__main__':
27 test_main()