Skip to content

Commit

Permalink
Remove errant print statements from tests (Qiskit#13702)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jakelishman authored Jan 21, 2025
1 parent 3c111be commit d884a3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 0 additions & 4 deletions test/python/circuit/test_circuit_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 3 additions & 1 deletion test/python/transpiler/test_vf2_post_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit d884a3c

Please sign in to comment.