added caplog for test_fit 10 02
@@ -53,6 +53,19 @@ class MyDataset(Dataset):
"""Statistic array, one value per data point."""
+
+@requires_dependency("sherpa")
+@pytest.mark.parametrize("backend", ["sherpa", "scipy"])
+def test_warning_no_covariance(backend, caplog):
+ dataset = MyDataset()
+ fit = Fit([dataset])
+ result = fit.run(backend=backend)
+ assert caplog.records[-1].levelname == "WARNING"
+ assert caplog.records[-1].message == "No covariance estimate - not supported by this backend."
+
+
+
+
@pytest.mark.parametrize("backend", ["minuit"])
def test_run(backend):
dataset = MyDataset()
@@ -147,6 +160,11 @@ def test_stat_profile():
assert_allclose(dataset.models.parameters["x"].value, 2)
+
+
+
+
+
def test_stat_profile_reoptimize():
dataset = MyDataset()
fit = Fit([dataset])
