INNER CODE UNIT · Python
test_verdicts
openHiTLS/openHiTLS · testcode/benchmark/async_perf/test_async_perf.py:194
def test_verdicts(self):
base = self.dataset("base", [100] * 5)
for value, verdict, code in ((100, "NOISE", 0), (90, "PASS", 0), (120, "FAIL", 1)):
with self.subTest(verdict=verdict):
proc = self.compare(base, self.dataset("cand", [value] * 5))
self.assertEqual(proc.returncode, code, proc.stdout)
self.assertIn(verdict, proc.stdout)
def test_noise_uses_repeats(self):
proc = self.compare(self.dataset("base", [80, 100, 120]), self.dataset("cand", [103] * 3))
self.assertEqual(proc.returncode, 0, proc.stdout)
self.assertIn("NOISE", proc.stdout)
def test_json_thresholds(self):
thresholds = self.root / "thresholds.json"
thresholds.write_text(json.dumps({"q1_sync_cross_build": 1.3, "noise_inline": 0.01}))
proc = self.compare(self.dataset("base", [100] * 5), self.dataset("cand", [120] * 5),
"--thresholds", thresholds)