diff --git a/probscale/tests/test_algo.py b/probscale/tests/test_algo.py index a68c018..4e4ce45 100644 --- a/probscale/tests/test_algo.py +++ b/probscale/tests/test_algo.py @@ -121,7 +121,7 @@ def test__bs_fit(plot_data, fitlogs, known_lo, known_hi): class Test__estimate_from_fit(object): - def setup(self): + def setup_method(self): self.x = numpy.arange(1, 11, 0.5) self.slope = 2 self.intercept = 3.5 diff --git a/probscale/tests/test_probscale.py b/probscale/tests/test_probscale.py index 2fa4693..40942c7 100644 --- a/probscale/tests/test_probscale.py +++ b/probscale/tests/test_probscale.py @@ -1,4 +1,5 @@ import os +import warnings import numpy import matplotlib.pyplot as plt @@ -120,16 +121,16 @@ def test_minimal_norm_cdf(mn, mn_input): def test_sign_with_nan_no_warning(mn): - with pytest.warns(None) as record: + with warnings.catch_warnings(): + warnings.simplefilter("error") res = mn._approx_erf(numpy.nan) - assert not record assert numpy.isnan(res) def test_sign_with_nan_no_warning_inv(mn): - with pytest.warns(None) as record: + with warnings.catch_warnings(): + warnings.simplefilter("error") res = mn._approx_inv_erf(numpy.nan) - assert not record assert numpy.isnan(res) diff --git a/probscale/tests/test_viz.py b/probscale/tests/test_viz.py index 18091f4..c63aaed 100644 --- a/probscale/tests/test_viz.py +++ b/probscale/tests/test_viz.py @@ -72,7 +72,7 @@ def plot_data(): class Test_fit_line(object): - def setup(self): + def setup_method(self): self.data = numpy.array( [ 2.00, @@ -454,7 +454,7 @@ def test_custom_xhat(self): class Test_plot_pos(object): - def setup(self): + def setup_method(self): self.data = numpy.arange(16) self.known_type4 = numpy.array( @@ -740,7 +740,6 @@ def test_probplot_prob(plot_data): fig, ax = plt.subplots() fig = viz.probplot(plot_data, ax=ax, problabel="Test xlabel", datascale="log") assert isinstance(fig, plt.Figure) - return fig @pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TIGHT_TOLERANCE) @@ -1026,7 +1025,6 @@ def test_probplot_test_results(plot_data): assert isinstance(results, dict) known_keys = sorted(["q", "x", "y", "xhat", "yhat", "res"]) assert sorted(list(results.keys())) == known_keys - return fig @pytest.mark.parametrize("probax", ["x", "y"])