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

update #290

Merged
merged 1 commit into from
Jan 2, 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
11 changes: 8 additions & 3 deletions tests/test_env/test_offline_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def gen_data(total_episode, data_save_path):


@pytest.fixture(scope="function")
def config(request, tmp_path):
def config(tmp_path):
total_episode = 5
data_save_path = tmp_path / "data.pkl"
gen_data(total_episode, data_save_path)
Expand All @@ -66,10 +66,15 @@ def config(request, tmp_path):
return cfg


@pytest.fixture(scope="function", params=[True, False])
def asynchronous(request):
return request.param


@pytest.mark.unittest
def test_offline_env(config):
def test_offline_env(asynchronous, config):
# create environment
env = make("OfflineEnv", env_num=1, cfg=config, asynchronous=True)
env = make("OfflineEnv", env_num=2, cfg=config, asynchronous=asynchronous)

for ep_index in range(10):
done = False
Expand Down