Skip to content

Commit eb6eecb

Browse files
committed
Fix pytest
1 parent 42c09e0 commit eb6eecb

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

codeclash/games/battlesnake/battlesnake.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def copy_logs_from_env(self, round_num):
4949
def get_stats(self, agents: list[Player]) -> RoundStats:
5050
scores = {}
5151
for idx in range(self.game_config["sims_per_round"]):
52-
ro = self.environment.execute(f"cat game/logs/sim_out_{idx}.json")["output"]
52+
ro = self.environment.execute(f"cat game/logs/sim_{idx}.txt")["output"]
5353
lines = ro.strip().split("\n")
5454
results = json.loads(lines[-1]) if lines else {} # Get the last line which contains the game result
5555
winner = RESULT_TIE if results["isDraw"] else results["winnerName"]
@@ -99,7 +99,7 @@ def _run_single_simulation(self, cmd: str, idx: int) -> tuple[str, str]:
9999
"""Run a single battlesnake simulation and return log and result outputs."""
100100
assert_zero_exit_code(
101101
self.environment.execute(
102-
cmd + f" -o logs/sim_out_{idx}.json",
102+
cmd + f" -o logs/sim_{idx}.txt",
103103
cwd=f"{self.environment.config.cwd}/game",
104104
)
105105
)

codeclash/tournaments/single_player.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def run_training_round(self, round_num: int) -> None:
9191
stats = self.game.run_round([self.agent, self.mirror_agent], round_num)
9292

9393
# Handle bookkeeping that was previously in the game
94-
self.scoreboard.append((round_num, stats))
94+
self.scoreboard.append(stats)
9595
self.logger.info(f"Round {round_num}:\n{stats}")
9696

9797
# Write log to file

0 commit comments

Comments
 (0)