import sys,json,os
from pathlib import Path
sys.path[:0]=['/out/source/tests','/out/source','/opt/contextra']
os.chdir('/out/source')
import pytest
class Report:
 def __init__(self):self.passed=0;self.failed=[]
 def pytest_runtest_logreport(self,report):
  r=report
  if r.failed:self.failed.append(dict(test=r.nodeid,phase=r.when))
  elif r.when=='call' and r.passed:self.passed+=1
r=Report()
names=['test_fall_r2','test_fall_core','test_fall_boundaries','test_fall_skip_hold','test_fall_integration','test_fight_r5','test_fight_notification','test_fight_notification_runtime','test_event_cooldown']
code=pytest.main(['-q','-p','no:cacheprovider',*['/out/source/tests/'+n+'.py' for n in names]],plugins=[r])
Path('/out/reports/unit_result.json').write_text(json.dumps(dict(exit_code=int(code),passed=r.passed,failed=r.failed),indent=2))
raise SystemExit(code)
