diff --git a/examples/rlbench_gym.py b/examples/rlbench_gym.py index 803415b72..db2f32b20 100644 --- a/examples/rlbench_gym.py +++ b/examples/rlbench_gym.py @@ -1,5 +1,6 @@ import gymnasium as gym from gymnasium.utils.performance import benchmark_step +import rlbench.gym env = gym.make('rlbench/reach_target-vision-v0', render_mode="rgb_array") diff --git a/tests/unit/test_examples.py b/tests/unit/test_examples.py new file mode 100644 index 000000000..678dcd02b --- /dev/null +++ b/tests/unit/test_examples.py @@ -0,0 +1,15 @@ +import pytest +from pathlib import Path + +@pytest.fixture +def root_dir(): + return Path(__file__).parents[2] + +@pytest.fixture(autouse=True) +def chdir_to_root(root_dir, monkeypatch): + monkeypatch.chdir(root_dir) + +@pytest.mark.parametrize("script_file", ["rlbench_gym.py", "rlbench_gym_vector.py"]) +def test_example(script_file): + import subprocess + subprocess.run(["python", f"examples/{script_file}"], check=True) \ No newline at end of file