diff --git a/lumicks/pylake/piezo_tracking/tests/test_piezo_tracking.py b/lumicks/pylake/piezo_tracking/tests/test_piezo_tracking.py index 513419b05..69a6949b7 100644 --- a/lumicks/pylake/piezo_tracking/tests/test_piezo_tracking.py +++ b/lumicks/pylake/piezo_tracking/tests/test_piezo_tracking.py @@ -1,5 +1,6 @@ import pytest import numpy as np +import matplotlib.pyplot as plt from lumicks.pylake.channel import Slice, Continuous, TimeSeries from lumicks.pylake.piezo_tracking.piezo_tracking import ( DistanceCalibration, @@ -83,6 +84,9 @@ def distance1(self): def test_plots(): distance_calibration = DistanceCalibration(*trap_pos_camera_distance(), 1) distance_calibration.plot() + # Needed since otherwise second plot will issue warning about changing layout (since they both + # call tight_layout() + plt.close('all') distance_calibration.plot_residual() diff --git a/lumicks/pylake/population/tests/test_dwelltimes.py b/lumicks/pylake/population/tests/test_dwelltimes.py index 02aff4c8f..02cf24bc5 100644 --- a/lumicks/pylake/population/tests/test_dwelltimes.py +++ b/lumicks/pylake/population/tests/test_dwelltimes.py @@ -292,10 +292,12 @@ def test_plots(exponential_data): dataset = exponential_data["dataset_2exp"] fit = DwelltimeModel(dataset["data"], 1, **dataset["parameters"].observation_limits) fit.hist() + plt.close('all') np.random.seed(123) bootstrap = fit.calculate_bootstrap(iterations=2) bootstrap.hist() + plt.close('all') with pytest.warns(DeprecationWarning): bootstrap.plot()