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