Lines Matching refs:str
24 def assertValid(self, str, symbol='single'):
25 '''succeed iff str is a valid piece of code'''
27 code = compile_command(str, "<input>", symbol)
35 exec(compile(str,"<input>","single"), r)
41 r = { 'value': eval(str,ctx) }
44 expected = compile(str, "<input>", symbol, PyCF_DONT_IMPLY_DEDENT)
45 self.assertEqual(compile_command(str, "<input>", symbol), expected)
47 def assertIncomplete(self, str, symbol='single'):
48 '''succeed iff str is the start of a valid piece of code'''
49 self.assertEqual(compile_command(str, symbol=symbol), None)
51 def assertInvalid(self, str, symbol='single', is_syntax=1):
52 '''succeed iff str is the start of an invalid piece of code'''
54 compile_command(str,symbol=symbol)
341 self.assertRegex(str(w[0].message), 'invalid escape sequence')