def _run_doctest(): from doctest import testmod as func func()
def load_tests(loader, tests, ignore): # (this is a unittest API hook-in) from doctest import DocTestSuite as func suite = func(subject_module()) tests.addTests(suite) return tests # (necessary (return our argument))
global_state.has_sentence = False rv = global_state.flush_me del global_state.flush_me return rv def flush_final_piece_row(): if len(pieces): rv = tuple(pieces) pieces.clear() return rv class global_state: has_sentence = False from .scanner_via import scanner_via_iterator as func scn = func(_pieces_via_jumble(itr)) # == Stack def stack_push(func, on_pop=None): stack.append(Frame(func, on_pop)) def stack_pop(): assert 1 < len(stack) # don't ever pop the base frame stack.pop() def run_any_on_pops_while_flushing_stack(): while len(stack): if (on_pop := top_frame().on_pop): on_pop() stack.pop()
def end_state(self): sout, sout_lines = spy_on_write_and_lines_for(self, 'DBG SOUT: ') coll = stateless_collection() func = self.subject_module._traverse_and_explain_whole_collection rc = func(sout, None, coll) return rc, tuple(sout_lines)
def import_toolkit_module(): from kiss_rdb_test.eno_support import import_sub_module as func return func('toolkit')
def coll_via_path(coll_path): from kiss_rdb_test.eno_support import coll_via_path as func return func(coll_path)
def _crizzy_tizzy_msgs(classis, fmt, keyer=None): mds = _re().finditer(r'(?:[^{]+)?(?:\{([a-z_]+)(?:[!]r)?\})?', fmt) sig = set(md[1] for md in mds if md[1] is not None) func = _func_via_sig(sig) return func(classis, sig, fmt, keyer)
def _build_identifier_parser(listener, cstacker=None): from . import build_identifier_parser_ as func return func(listener, cstacker)