From b7b6e1ea949ef7bc77cd49e6824803ec157b75c1 Mon Sep 17 00:00:00 2001 From: Alessandro Cosentino Date: Mon, 29 Apr 2024 11:26:44 +0200 Subject: [PATCH] Fix global tqdm module patch in test (#2319) --- mitiq/shadows/tests/test_quantum_processing.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mitiq/shadows/tests/test_quantum_processing.py b/mitiq/shadows/tests/test_quantum_processing.py index e79b730f26..57193daadd 100644 --- a/mitiq/shadows/tests/test_quantum_processing.py +++ b/mitiq/shadows/tests/test_quantum_processing.py @@ -45,6 +45,10 @@ def test_tqdm_import_not_available(): ) # Reload the module to trigger the import assert mitiq.shadows.quantum_processing.tqdm is None + # Reload the module again to restore the original tqdm import. + # Otherwise, the rest of the tests are affected by the patch (issue #2318) + importlib.reload(mitiq.shadows.quantum_processing) + def test_generate_random_pauli_strings(): """Tests that the function generates random Pauli strings."""