Skip to content

Commit

Permalink
Fix PrimalSearch action type in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoinePrv committed Jun 17, 2021
1 parent 1683709 commit 4dd75bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions python/tests/test_dynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,12 @@ def assert_action_set(action_set):

@staticmethod
def policy(action_set):
return {a: 0.0 for a in action_set}
# Mixed numpy array and list
return (action_set, [0.0] * len(action_set))

@staticmethod
def bad_policy(action_set):
return {1 << 31: 0.0}
return ([1 << 31], [0.0])

def setup_method(self, method):
self.dynamics = ecole.dynamics.PrimalSearchDynamics()
2 changes: 1 addition & 1 deletion python/tests/test_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_reset(model):
env = MockEnvironment()
_, _, _, _, _ = env.reset(model)
assert model is not env.model # Model is copied
assert not env.model.is_solved()
assert not env.model.is_solved

env.dynamics.reset_dynamics.assert_called_with(env.model)
env.dynamics.set_dynamics_random_state.assert_called()
Expand Down

0 comments on commit 4dd75bb

Please sign in to comment.