From 902ef0b865a00db4fc96e9795c2ccc1c67f1e08f Mon Sep 17 00:00:00 2001 From: Hsien-Cheng Huang Date: Wed, 13 May 2026 17:47:05 +0000 Subject: [PATCH] test(qdp_python): match actual ValueError from QuantumDataLoader.backend() `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 270f3f2638..381fb6d95b 100644 --- a/testing/qdp_python/test_fallback.py +++ b/testing/qdp_python/test_fallback.py @@ -273,7 +273,10 @@ def test_streaming_raises(self): 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")