Debian Codegraph @

pypy/module/_sre/test/test_sre_buf.py

raw symbols SCIP
1 from pypy.module._sre.test import test_app_sre
2 from pypy.module._sre import interp_sre
3 from rpython.rlib.rsre import rsre_core
4 from rpython.rlib.buffer import StringBuffer
5
6
7 def _test_sre_ctx_buf_(self, str, start, end):
8 # Test BufMatchContext.
9 buf = StringBuffer(str)
10 return rsre_core.BufMatchContext(buf, start, end)
11
12 def setup_module(mod):
13 mod._org_maker = (
14 interp_sre.W_SRE_Pattern._make_str_match_context,
15 )
16 interp_sre.W_SRE_Pattern._make_str_match_context = _test_sre_ctx_buf_
17
18 def teardown_module(mod):
19 (
20 interp_sre.W_SRE_Pattern._make_str_match_context,
21 ) = mod._org_maker
22
23
24 class AppTestSreMatchBuf(test_app_sre.AppTestSreMatch):
25 pass