Skip to content

Commit 8c506b9

Browse files
Vincent Moensvmoens
authored andcommitted
[BugFix] Fix env.shape regex matches (#1940)
1 parent 4723747 commit 8c506b9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

test/test_env.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def test_mb_env_batch_lock(self, device, seed=0):
346346
mb_env.step(td)
347347

348348
with pytest.raises(
349-
RuntimeError, match=re.escape("Expected a tensordict with shape==env.shape")
349+
RuntimeError, match=re.escape("Expected a tensordict with shape==env.batch_size")
350350
):
351351
mb_env.step(td_expanded)
352352

@@ -1615,7 +1615,7 @@ def test_batch_locked(device):
16151615
_ = env.step(td)
16161616

16171617
with pytest.raises(
1618-
RuntimeError, match="Expected a tensordict with shape==env.shape, "
1618+
RuntimeError, match="Expected a tensordict with shape==env.batch_size, "
16191619
):
16201620
env.step(td_expanded)
16211621

test/test_transforms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8231,7 +8231,7 @@ def test_batch_locked_transformed(device):
82318231
env.step(td)
82328232

82338233
with pytest.raises(
8234-
RuntimeError, match="Expected a tensordict with shape==env.shape, "
8234+
RuntimeError, match="Expected a tensordict with shape==env.batch_size, "
82358235
):
82368236
env.step(td_expanded)
82378237

@@ -8275,7 +8275,7 @@ def test_batch_unlocked_with_batch_size_transformed(device):
82758275
td_expanded = td.expand(2, 2).reshape(-1).to_tensordict()
82768276

82778277
with pytest.raises(
8278-
RuntimeError, match="Expected a tensordict with shape==env.shape, "
8278+
RuntimeError, match="Expected a tensordict with shape==env.batch_size, "
82798279
):
82808280
env.step(td_expanded)
82818281

0 commit comments

Comments
 (0)