Skip to content

Commit

Permalink
Close VecEnv when finished
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamGleave committed Mar 9, 2019
1 parent de7ab31 commit 4d3fed9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_vec_envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ def make_env():
assert setattr_result == [None for _ in range(2)]
assert getattr_result == [12] + [0 for _ in range(N_ENVS - 2)] + [12]

vec_env.close()


SPACES = collections.OrderedDict([
('discrete', gym.spaces.Discrete(2)),
Expand All @@ -118,6 +120,7 @@ def make_env():
actions = [vec_env.action_space.sample() for _ in range(N_ENVS)]
obs, _rews, dones, _infos = vec_env.step(actions)
obs_assert(obs)
vec_env.close()


def check_vecenv_obs(obs, space):
Expand Down

0 comments on commit 4d3fed9

Please sign in to comment.