Skip to content

Commit 1b6f525

Browse files
committed
✅ Fix ValueError message text in TestUNetProcessor
1 parent 501b272 commit 1b6f525

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/models/test_processors.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import re
2+
13
import pytest
24
import torch
35

@@ -146,8 +148,8 @@ def test_forward_shape(
146148

147149
# We will either catch an error or see a successful run
148150
if height % 16 or width % 16:
149-
msg = f"Latent space height and width must be divisible by 16 with a factor more than 1, got {height} and {width}."
150-
with pytest.raises(ValueError, match=msg):
151+
msg = f"Latent space height ({height}) and width ({width}) must each be divisible by 16 with a factor more than 1."
152+
with pytest.raises(ValueError, match=re.escape(msg)):
151153
processor.rollout(x)
152154
else:
153155
result = processor.rollout(x)

0 commit comments

Comments
 (0)