From d884a3cc10d42ca9605afd3ce2996c4999b6917f Mon Sep 17 00:00:00 2001 From: Jake Lishman Date: Tue, 21 Jan 2025 14:45:17 +0000 Subject: [PATCH] Remove errant `print` statements from tests (#13702) If any `print` is necessary for debugging failed test cases, we probably ought to reconfigure the test runner's display mechanisms, or use the built-in configuration of the `unittest` assert methods to produce better results. --- test/python/circuit/test_circuit_data.py | 4 ---- test/python/transpiler/test_vf2_post_layout.py | 4 +++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/test/python/circuit/test_circuit_data.py b/test/python/circuit/test_circuit_data.py index 9568c1c42084..8918a9f2192b 100644 --- a/test/python/circuit/test_circuit_data.py +++ b/test/python/circuit/test_circuit_data.py @@ -320,10 +320,6 @@ def test_delitem_slice(self, sli): del data_list[sli] del data[sli] - if data_list[sli] != data[sli]: - print(f"data_list: {data_list}") - print(f"data: {list(data)}") - self.assertEqual(data[sli], data_list[sli]) @ddt.data( diff --git a/test/python/transpiler/test_vf2_post_layout.py b/test/python/transpiler/test_vf2_post_layout.py index 592987e62dbf..9aaab695197a 100644 --- a/test/python/transpiler/test_vf2_post_layout.py +++ b/test/python/transpiler/test_vf2_post_layout.py @@ -267,7 +267,9 @@ def test_2q_circuit_5q_backend_max_trials(self): f"is >= configured max trials {max_trials}", cm.output, ) - print(pass_.property_set["VF2PostLayout_stop_reason"]) + self.assertEqual( + pass_.property_set["VF2PostLayout_stop_reason"], VF2PostLayoutStopReason.SOLUTION_FOUND + ) self.assertLayout(dag, cmap, pass_.property_set) self.assertNotEqual(pass_.property_set["post_layout"], initial_layout)