

def test_get_expression(self):
    get = self.get_parser
    p = get('4.2')
    self.assertEqual(p.get_expression(), 'y ')
    p = get('4.7')
    with self.assertRaises(ValueError) as ve:
        p.get_expression()
    get.assertIn('is inside a code', str(ve.exception))
    p = get('5.25')
    self.assertEqual(p.get_expression(), 'range(10)')
    p = get('6.7')
    self.assertEqual(p.get_expression(), 'py')
    p = get('6.8')
    self.assertEqual(p.get_expression(), '')
    p = get('7.9')
    self.assertEqual(p.get_expression(), 'py')
    p = get('8.end')
    self.assertEqual(p.get_expression(), 'x.__len__')
    p = get('9.13')
    self.assertEqual(p.get_expression(), "r'asdf'")
    p = get('9.17')
    with self.assertRaises(ValueError) as ve:
        p.get_expression()
    self.assertIn('is inside a code', str(ve.exception))
    p = get('10.0')
    self.assertEqual(p.get_expression(), '')
    p = get('11.3')
    self.assertEqual(p.get_expression(), '')
    p = get('11.11')
    self.assertEqual(p.get_expression(), 'False')

dataset/ETHPy150Open francelabs/datafari/windows/python/Lib/idlelib/idle_test/test_hyperparser.py HyperParserTest.test_get_expression/VarMisuse@62/83 `self`->`get`