Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
bovard committed Oct 9, 2024
1 parent 58f59fa commit a1af469
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docker/cpu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ ADD ./setup.py ./setup.py
ADD ./README.md ./README.md
ADD ./MANIFEST.in ./MANIFEST.in
ADD ./kaggle_environments ./kaggle_environments
RUN pip install Flask bitsandbytes accelerate vec-noise && pip install . && pytest
RUN pip install Flask bitsandbytes accelerate vec-noise chess && pip install . && pytest

CMD kaggle-environments
2 changes: 1 addition & 1 deletion kaggle_environments/envs/chess/chess.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def interpreter(state, env):
# Check if the move is legal
try:
move = chess.Move.from_uci(action)
if move not in board_obj.legal_moves:
if not board_obj.is_legal(move):
raise ValueError("Illegal move")
except:
active.status = ERROR
Expand Down
9 changes: 3 additions & 6 deletions kaggle_environments/envs/chess/test_chess.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
from kaggle_environments import make
from .agents import random_agent

env = None

def test_chess_completes():
def test_chess_inits():
env = make("chess", debug=True)
env.run([random_agent, random_agent])
env.run(["random", "random"])
json = env.toJSON()
assert json["name"] == "chess"
assert json["statuses"] == ["DONE", "DONE"]
assert json["statuses"] == ["ERROR", "DONE"]

0 comments on commit a1af469

Please sign in to comment.