Skip to content

Commit a3f342f

Browse files
committed
test(cuda.core): fix options regex for AdviseOptions ("an" vs "a")
The advise() error message reads "must be an AdviseOptions instance or None" (vowel triggers "an"), but the regex matched only "must be a ". Relax to "must be an?" so all three op tests pass.
1 parent ab9a3ab commit a3f342f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

cuda_core/tests/memory/test_managed_ops.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ def test_options_must_be_none(self, init_cuda):
517517
mr = create_managed_memory_resource_or_skip()
518518
buf = mr.allocate(_MANAGED_TEST_ALLOCATION_SIZE)
519519
stream = device.create_stream()
520-
with pytest.raises(TypeError, match="must be a .*Options instance or None"):
520+
with pytest.raises(TypeError, match="must be an? .*Options instance or None"):
521521
prefetch(buf, Location.host(), options={}, stream=stream)
522522
buf.close()
523523

@@ -578,7 +578,7 @@ def test_options_must_be_none(self, init_cuda):
578578
mr = create_managed_memory_resource_or_skip()
579579
buf = mr.allocate(_MANAGED_TEST_ALLOCATION_SIZE)
580580
stream = device.create_stream()
581-
with pytest.raises(TypeError, match="must be a .*Options instance or None"):
581+
with pytest.raises(TypeError, match="must be an? .*Options instance or None"):
582582
discard(buf, options={}, stream=stream)
583583
buf.close()
584584

@@ -706,6 +706,6 @@ def test_options_must_be_none(self, init_cuda):
706706
_skip_if_managed_allocation_unsupported(device)
707707
device.set_current()
708708
buf = DummyUnifiedMemoryResource(device).allocate(_MANAGED_TEST_ALLOCATION_SIZE)
709-
with pytest.raises(TypeError, match="must be a .*Options instance or None"):
709+
with pytest.raises(TypeError, match="must be an? .*Options instance or None"):
710710
advise(buf, "set_read_mostly", options={})
711711
buf.close()

0 commit comments

Comments
 (0)