Skip to content

Commit

Permalink
Use assertIn instead of assertContainsSubsequence for substring checks.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 690716793
  • Loading branch information
Dopamine Team authored and psc-g committed Oct 29, 2024
1 parent 9f616b9 commit a804d3c
Show file tree
Hide file tree
Showing 40 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions dopamine/discrete_domains/atari_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class has two main functions: `.__init__` and `.call`. When we create our

from absl import logging

from ale_py import registration
import ale_py
from baselines.common import atari_wrappers
import cv2
import gin
Expand Down Expand Up @@ -108,8 +108,8 @@ def create_atari_environment(
full_game_name = f'{game_name}NoFrameskip-{game_version}'
env = legacy_gym.make(full_game_name)
else:
registration.register_v5_envs()
registration.register_v5_envs()
gym.register_envs(ale_py)
gym.register_envs(ale_py)
full_game_name = f'ALE/{game_name}-v5'
repeat_action_probability = 0.25 if sticky_actions else 0.0
continuous = continuous_action_threshold is not None
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/dopamine/jax/replay_memory/samplers_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ def test_update_does_not_raise_and_logs(self):
with self.assertLogs(level="INFO") as logs:
self.sampler.update(0, None, [], arg_x=1, arg_y=2)
self.assertLen(logs.output, 1)
self.assertContainsSubsequence(logs.output[0], "is a no-op")
self.assertIn("is a no-op", logs.output[0])

def test_additional_kwargs_to_add_logs(self):
with self.assertLogs(level="INFO") as logs:
self.sampler.add(1, dummy_kwargs="dummy")
self.assertLen(logs.output, 1)
self.assertContainsSubsequence(logs.output[0], "dummy_kwargs")
self.assertIn("dummy_kwargs", logs.output[0])

def test_sample_when_empty(self):
with self.assertRaises(ValueError):
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit a804d3c

Please sign in to comment.