1 parent 5aa584b commit 28c5c9fCopy full SHA for 28c5c9f
1 file changed
tests/test_frontends.py
@@ -72,10 +72,20 @@ def test_explicit_optional_frontend_for_qiskit_raises_mismatch() -> None:
72
detect_frontend(_qiskit_bell(), frontend="braket")
73
74
75
-def test_explicit_optional_frontend_missing_dependency_has_install_hint() -> None:
+def test_explicit_optional_frontend_missing_dependency_has_install_hint(
76
+ monkeypatch: pytest.MonkeyPatch,
77
+) -> None:
78
class UnknownCircuit:
79
pass
80
81
+ def missing_braket(_frontend: Frontend) -> type:
82
+ raise frontends.FrontendDependencyError(
83
+ "frontend='braket' requires optional Braket support.\n"
84
+ 'Install with: pip install "emrg[braket]"'
85
+ )
86
+
87
+ monkeypatch.setattr(frontends, "_load_frontend_type", missing_braket)
88
89
with pytest.raises(
90
ImportError,
91
match=(
0 commit comments