Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tests] Fix VMAS tests #2287

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
amend
  • Loading branch information
matteobettini committed Jul 10, 2024
commit fc1387c9740c4b79f2c9daaf4f99167a3a0c02f5
14 changes: 1 addition & 13 deletions test/test_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2143,7 +2143,6 @@ def test_vmas_seeding(self, scenario_name):
@pytest.mark.parametrize("scenario_name", VmasWrapper.available_envs)
def test_vmas_batch_size_error(self, scenario_name, batch_size):
num_envs = 12
n_agents = 2
if len(batch_size) > 1:
with pytest.raises(
TypeError,
Expand All @@ -2152,7 +2151,6 @@ def test_vmas_batch_size_error(self, scenario_name, batch_size):
_ = VmasEnv(
scenario=scenario_name,
num_envs=num_envs,
n_agents=n_agents,
batch_size=batch_size,
)
elif len(batch_size) == 1 and batch_size != (num_envs,):
Expand All @@ -2163,14 +2161,12 @@ def test_vmas_batch_size_error(self, scenario_name, batch_size):
_ = VmasEnv(
scenario=scenario_name,
num_envs=num_envs,
n_agents=n_agents,
batch_size=batch_size,
)
else:
env = VmasEnv(
scenario=scenario_name,
num_envs=num_envs,
n_agents=n_agents,
batch_size=batch_size,
)
env.close()
Expand Down Expand Up @@ -2252,19 +2248,11 @@ def test_vmas_spec_rollout(
env.close()

@pytest.mark.parametrize("num_envs", [1, 20])
@pytest.mark.parametrize("n_agents", [1, 5])
@pytest.mark.parametrize("scenario_name", VmasWrapper.available_envs)
def test_vmas_repr(self, scenario_name, num_envs, n_agents):
if (
n_agents == 1
and scenario_name == "balance"
or scenario_name == "simple_adversary"
):
return
def test_vmas_repr(self, scenario_name, num_envs):
env = VmasEnv(
scenario=scenario_name,
num_envs=num_envs,
n_agents=n_agents,
)
assert str(env) == (
f"{VmasEnv.__name__}(num_envs={num_envs}, n_agents={env.n_agents},"
Expand Down
Loading