Skip to content

Commit

Permalink
fixing te interface test
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoRobbiati committed Jan 13, 2025
1 parent bef5c1b commit 5c903e9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/test_models_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ def test_decoding(backend, frontend, layer, seed):
kwargs["observable"] = observable
kwargs["nshots"] = None

# test error
if layer is dec.Samples:
kwargs["nshots"] = 1000

Expand All @@ -337,6 +336,14 @@ def test_decoding(backend, frontend, layer, seed):
)

data = random_tensor(frontend, (100, dim))

if backend.platform != "pytorch" and differentiation is None:
with pytest.raises(ValueError):
_ = prepare_targets(frontend, q_model, data)
pytest.skip(
"Skipping the rest of the test since the raise error has been successfully tested."
)

target = prepare_targets(frontend, q_model, data)

if layer is dec.Samples:
Expand Down

0 comments on commit 5c903e9

Please sign in to comment.