Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent babe18b commit 76d8c9fCopy full SHA for 76d8c9f
Lib/test/test_flufl.py
@@ -47,6 +47,19 @@ def test_barry_as_bdfl_look_ma_with_no_compiler_flags(self):
47
self.assertEqual(cm.exception.lineno, 1)
48
self.assertEqual(cm.exception.offset, len(code) - 4)
49
50
+ def test_barry_as_bdfl_relative_import(self):
51
+ code = "from .__future__ import barry_as_FLUFL;2 {0} 3"
52
+ compile(code.format('!='), '<FLUFL test>', 'exec')
53
+ with self.assertRaises(SyntaxError) as cm:
54
+ compile(code.format('<>'), '<BDFL test>', 'exec')
55
+ self.assertRegex(str(cm.exception), "<BDFL test>")
56
+ self.assertIn('2 <> 3', cm.exception.text)
57
+ self.assertEqual(cm.exception.filename, '<BDFL test>')
58
+ self.assertEqual(cm.exception.lineno, 1)
59
+ self.assertEqual(cm.exception.offset, len(code) - 4)
60
+
61
62
63
64
if __name__ == '__main__':
65
unittest.main()
0 commit comments