holy fuking shit

This commit is contained in:
Horldsence
2026-09-12 01:56:34 +08:00
parent 36f354736c
commit d975309a81
83 changed files with 2748 additions and 896 deletions
+7 -5
View File
@@ -43,21 +43,21 @@ def test_fallback_failure_then_success_records_actual_time_position_and_clear():
assert loop.client.state.channel == 20
assert loop.fallback_log[-1]["attempts"] == 2
assert 20 not in loop.blocked_probes
assert loop.anomalies == []
assert not loop.anomalies
finally:
loop.client.exit()
def test_invalid_policy_output_is_logged_and_replaced_by_valid_action():
class InvalidPolicy:
def select(self, observation, mask):
def select(self, _observation, _mask):
return N_CANDIDATES + 1
loop = make_loop(problem=3, high_policy=InvalidPolicy())
candidate = Candidate(STATION_OFFSET, "station", (0.0, 0.0), station_index=0)
executed = []
def execute(action, candidates):
def execute(action, candidates): # pylint: disable=unused-argument
executed.append(action)
loop.stop_reason = "test_complete"
@@ -78,8 +78,10 @@ def test_opportunistic_measure_precedes_candidate_snapshot():
order = []
try:
assert loop.config.bayes.opportunistic_measure
with patch.object(loop, "_measure_at_stop", side_effect=lambda: order.append("measure")), \
patch.object(loop, "build_candidates", side_effect=lambda: order.append("snapshot") or []):
with patch.object(loop, "_measure_at_stop",
side_effect=lambda: order.append("measure")), \
patch.object(loop, "build_candidates",
side_effect=lambda: order.append("snapshot") or []):
loop._coverage_phase()
assert order == ["measure", "snapshot"]
finally: