bearomorphism commented on code in PR #1143:
URL: https://github.com/apache/mahout/pull/1143#discussion_r2899809404


##########
testing/qumat/test_multi_qubit_gates.py:
##########
@@ -414,14 +415,15 @@ def test_gate_on_uninitialized_circuit(self, 
backend_name, gate_name, gate_args)
         """Test that gates raise error on uninitialized circuit."""
         backend_config = get_backend_config(backend_name)
         qumat = QuMat(backend_config)
-        with pytest.raises(RuntimeError, match="circuit not initialized"):
-            if gate_name == "cnot":
+        if gate_name == "cnot":
+            with pytest.raises(RuntimeError, match="circuit not initialized"):
                 qumat.apply_cnot_gate(*gate_args)
-            else:
+        else:
+            with pytest.raises(RuntimeError, match="circuit not initialized"):
                 qumat.apply_toffoli_gate(*gate_args)

Review Comment:
   `pytest.raise` should not contain more than one statements (PT012)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to