import subprocess, os, runpy, sys from pathlib import Path root=Path('/home/jakub/devel/escapistsrereintroduced') sys.path.insert(0,str(root/'tools')) original=subprocess.run calls=[] def run(args,*a,**kw): if isinstance(args,list) and len(args)>1 and '/tests/' in str(args[1]) and str(args[1]).endswith('.py'): calls.append(Path(args[1]).name) env=dict(os.environ);env.pop('TMPDIR',None) if Path(args[1]).name=='test_native_package.py': env['TMPDIR']=str(root/'.build/death-diagnostic-2153/test-tmp') kw['env']=env return original(args,*a,**kw) subprocess.run=run runpy.run_path(str(root/'tools/check.py'),run_name='__main__') assert len(calls)==272,len(calls) print('VERIFIED: 272 registered programs; only native_package temporary fixture storage relocated to disk, native canonical /tmp session validation unchanged.')