diff --git a/bindings/pydrake/examples/gym/play_cart_pole.py b/bindings/pydrake/examples/gym/play_cart_pole.py index 21f57b06f865..58e6f842d5da 100644 --- a/bindings/pydrake/examples/gym/play_cart_pole.py +++ b/bindings/pydrake/examples/gym/play_cart_pole.py @@ -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 @@ -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", diff --git a/bindings/pydrake/gym/test/drake_gym_test.py b/bindings/pydrake/gym/test/drake_gym_test.py index 7e83fc38c795..69658f0472bc 100644 --- a/bindings/pydrake/gym/test/drake_gym_test.py +++ b/bindings/pydrake/gym/test/drake_gym_test.py @@ -1,4 +1,3 @@ -import sys import unittest import gymnasium as gym @@ -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() @@ -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() @@ -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()