From f5b5fcdf618eed722e0fe35033fce41f2769d7ce Mon Sep 17 00:00:00 2001 From: Frank Harkins Date: Tue, 14 May 2024 14:17:31 +0100 Subject: [PATCH 1/2] Change MPL loglevel --- scripts/nb-tester/qiskit_docs_notebook_tester/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/nb-tester/qiskit_docs_notebook_tester/__init__.py b/scripts/nb-tester/qiskit_docs_notebook_tester/__init__.py index 730451fd057..46448c9a9c8 100644 --- a/scripts/nb-tester/qiskit_docs_notebook_tester/__init__.py +++ b/scripts/nb-tester/qiskit_docs_notebook_tester/__init__.py @@ -33,8 +33,8 @@ # We always run the following code in the kernel before running the notebook PRE_EXECUTE_CODE = """\ -import warnings -warnings.filterwarnings("ignore", message="Matplotlib is building the font cache; this may take a moment.") +import matplotlib +matplotlib.set_loglevel("critical") """ # If not submitting jobs, we also run this code before notebook execution to mock the real backend From 69e2f40c33e241b75dbb0134cdf02c165b64fc78 Mon Sep 17 00:00:00 2001 From: Frank Harkins Date: Tue, 14 May 2024 15:08:18 +0100 Subject: [PATCH 2/2] Update scripts/nb-tester/qiskit_docs_notebook_tester/__init__.py --- scripts/nb-tester/qiskit_docs_notebook_tester/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/nb-tester/qiskit_docs_notebook_tester/__init__.py b/scripts/nb-tester/qiskit_docs_notebook_tester/__init__.py index 46448c9a9c8..76284e0e33e 100644 --- a/scripts/nb-tester/qiskit_docs_notebook_tester/__init__.py +++ b/scripts/nb-tester/qiskit_docs_notebook_tester/__init__.py @@ -34,6 +34,7 @@ # We always run the following code in the kernel before running the notebook PRE_EXECUTE_CODE = """\ import matplotlib +# See https://github.com/matplotlib/matplotlib/issues/23326#issuecomment-1164772708 matplotlib.set_loglevel("critical") """