From 462daf3300836155fdb16349f2b9523a7070f32c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elena=20Pe=C3=B1a=20Tapia?= <57907331+ElePT@users.noreply.github.com> Date: Fri, 23 Aug 2024 13:04:35 +0200 Subject: [PATCH] Filter aer warnings in deprecated `FakeBackend` V1 class (#13018) * Filter aer warnings in fake backend for the deprecated V1 path * Filter warnings in QiskitTestCase instead of catching them (cherry picked from commit 6b6efc7d547e5baef7d906c850e2bc69ed6430fb) --- test/utils/base.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/utils/base.py b/test/utils/base.py index e1b2180aac4e..0038f7772ebf 100644 --- a/test/utils/base.py +++ b/test/utils/base.py @@ -156,6 +156,14 @@ def setUpClass(cls): module="qiskit_aer", ) + # Safe to remove once `FakeBackend` is removed (2.0) + warnings.filterwarnings( + "ignore", # If "default", it floods the CI output + category=DeprecationWarning, + message=r".*from_backend using V1 based backend is deprecated as of Aer 0.15*", + module="qiskit.providers.fake_provider.fake_backend", + ) + allow_DeprecationWarning_message = [ r"The property ``qiskit\.circuit\.bit\.Bit\.(register|index)`` is deprecated.*", ]