Lines Matching refs:code

263             code = textwrap.dedent("""
270 rc, out, err = assert_python_failure('-c', code)
291 code = textwrap.dedent("""
298 rc, out, err = assert_python_failure('-c', code)
326 code = textwrap.dedent("""
333 rc, out, err = assert_python_failure('-c', code)
356 code = """if 1:
382 rc, out, err = assert_python_ok('-c', code)
532 code = textwrap.dedent("""
539 rc, out, err = assert_python_failure('-c', code)
765 def check_fatal_error(self, code, expected, not_expected=()):
767 rc, out, err = assert_python_failure('-sSI', '-c', code)
792 code = 'import _testcapi, sys; _testcapi.fatal_error(b"MESSAGE")'
793 self.check_fatal_error(code, expected, not_expected)
798 code = textwrap.dedent('''
803 self.check_fatal_error(code, expected)
820 code = b"# -*- coding: latin1 -*-\nprint('\xc2\xa4')\n"
821 result = _compile(code)
822 expected = compile(code, "<string>", "exec")
884 code = _testcapi.function_get_code(some)
885 self.assertIsInstance(code, types.CodeType)
886 self.assertEqual(code, some.__code__)
1000 code = """if 1:
1007 ret = support.run_in_subinterp(code)
1015 code = """if 1:
1030 ret = support.run_in_subinterp(code)
1108 code = textwrap.dedent(f"""
1116 ret = assert_python_ok('-X', 'tracemalloc', '-c', code)
1146 def check(self, code):
1149 '-c', code,
1193 def check_malloc_without_gil(self, code):
1194 out = self.check(code)
1202 code = 'import _testcapi; _testcapi.pymem_malloc_without_gil()'
1203 self.check_malloc_without_gil(code)
1208 code = 'import _testcapi; _testcapi.pyobject_malloc_without_gil()'
1209 self.check_malloc_without_gil(code)
1212 code = textwrap.dedent(f'''
1225 '-c', code,