ยปCore Development>Code coverage>Lib/test/test_flufl.py

Python code coverage for Lib/test/test_flufl.py

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