Skip to content

Commit

Permalink
[bindings] Re-enable some gym test cases on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jwnimmer-tri committed Nov 1, 2024
1 parent d6ff6cc commit b035c85
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
7 changes: 0 additions & 7 deletions bindings/pydrake/examples/gym/play_cart_pole.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Play a policy for //bindings/pydrake/examples/gym/envs:cart_pole.
"""
import argparse
import sys
import warnings

import gymnasium as gym
Expand Down Expand Up @@ -71,12 +70,6 @@ def _main():
parser.add_argument('--log_path', help="path to the logs directory.")
args = parser.parse_args()

if args.test and (sys.platform == "darwin"):
# TODO(#21577) Importing Gym on macOS Homebrew goes up in flames.
# We need to skip this test in Drake CI.
print("Testing is disabled when on macOS")
return

if not args.debug:
warnings.filterwarnings("ignore")
gym.envs.register(id="DrakeCartPole-v0",
Expand Down
9 changes: 0 additions & 9 deletions bindings/pydrake/gym/test/drake_gym_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
import unittest

import gymnasium as gym
Expand Down Expand Up @@ -26,13 +25,9 @@ def setUpClass(cls):
def make_env(self):
return gym.make("DrakeCartPole-v0")

# TODO(#21577) Importing Gym on macOS Homebrew goes up in flames.
@unittest.skipIf(sys.platform == "darwin", "Disabled macOS")
def test_make_env(self):
self.make_env()

# TODO(#21577) Importing Gym on macOS Homebrew goes up in flames.
@unittest.skipIf(sys.platform == "darwin", "Disabled macOS")
def test_sb3_check_env(self):
"""Run stable-baselines's built-in test suite for our env."""
dut = self.make_env()
Expand All @@ -45,8 +40,6 @@ def test_sb3_check_env(self):
# supported versions of `gymnasium` and `stable_baselines3`, stable
# baselines vector envs do not pass stable baselines' `check_env` tests.

# TODO(#21577) Importing Gym on macOS Homebrew goes up in flames.
@unittest.skipIf(sys.platform == "darwin", "Disabled macOS")
def test_reset(self):
# reset(int) sets a deterministic seed.
dut = self.make_env()
Expand All @@ -68,8 +61,6 @@ def test_reset(self):
self.assertIsInstance(opts, dict)
self.assertTrue(dut.observation_space.contains(observation))

# TODO(#21577) Importing Gym on macOS Homebrew goes up in flames.
@unittest.skipIf(sys.platform == "darwin", "Disabled macOS")
def test_step(self):
dut = self.make_env()
dut.reset()
Expand Down

0 comments on commit b035c85

Please sign in to comment.