This is an automated email from the ASF dual-hosted git repository.
ryankert01 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/mahout.git
The following commit(s) were added to refs/heads/main by this push:
new afbaf00e6 test(qdp_python): match actual ValueError from
QuantumDataLoader.backend() (#1314)
afbaf00e6 is described below
commit afbaf00e6729256318a36f3a601c86cc1806a654
Author: Ryan Huang <[email protected]>
AuthorDate: Thu May 14 02:01:35 2026 +0800
test(qdp_python): match actual ValueError from QuantumDataLoader.backend()
(#1314)
`test_invalid_backend_raises` was asserting an older error message
format ('rust', 'pytorch', or 'auto'), but `QuantumDataLoader.backend()`
now raises 'backend must be one of ["auto", "pytorch", "rust"], got
"invalid"' (qdp/qdp-python/qumat_qdp/loader.py:355). Update the regex
to match the current sorted-list format.
Discovered while running the testing/ suite against the qumat-qdp
0.2.0rc1 wheel installed from TestPyPI.
---
testing/qdp_python/test_fallback.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/testing/qdp_python/test_fallback.py
b/testing/qdp_python/test_fallback.py
index 270f3f263..381fb6d95 100644
--- a/testing/qdp_python/test_fallback.py
+++ b/testing/qdp_python/test_fallback.py
@@ -273,7 +273,10 @@ class TestLoaderPytorchBackend:
def test_invalid_backend_raises(self):
from qumat_qdp.loader import QuantumDataLoader
- with pytest.raises(ValueError, match="'rust', 'pytorch', or 'auto'"):
+ with pytest.raises(
+ ValueError,
+ match=r"backend must be one of \['auto', 'pytorch', 'rust'\], got
'invalid'",
+ ):
QuantumDataLoader(device_id=0).backend("invalid")