From 612e6c742becae6c5f2b129389d7f9bd94c04f5c Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Tue, 14 Jun 2022 14:46:45 +0100 Subject: [PATCH] tests: matplotlib figures explicitly closed in tests --- tests/correlators_test.py | 2 ++ tests/obs_test.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/tests/correlators_test.py b/tests/correlators_test.py index 0aadcb85..3cfa230b 100644 --- a/tests/correlators_test.py +++ b/tests/correlators_test.py @@ -1,6 +1,7 @@ import os import numpy as np import scipy +import matplotlib.pyplot as plt import pyerrors as pe import pytest @@ -440,6 +441,7 @@ def test_spaghetti_plot(): corr.spaghetti_plot(True) corr.spaghetti_plot(False) + plt.close('all') def _gen_corr(val, samples=2000): diff --git a/tests/obs_test.py b/tests/obs_test.py index 2a158c3e..5b6a8509 100644 --- a/tests/obs_test.py +++ b/tests/obs_test.py @@ -1,6 +1,7 @@ import autograd.numpy as np import os import copy +import matplotlib.pyplot as plt import pyerrors as pe import pytest @@ -56,6 +57,7 @@ def test_Obs_exceptions(): one.gamma_method() with pytest.raises(Exception): one.plot_piechart() + plt.close('all') def test_dump(): value = np.random.normal(5, 10) @@ -368,6 +370,7 @@ def test_utils(): assert my_obs < (my_obs + 1) float(my_obs) str(my_obs) + plt.close('all') def test_cobs():