Code Duplication    Length = 11-13 lines in 2 locations

gammapy/modeling/tests/test_fit.py 2 locations

@@ 139-151 (lines=13) @@
136
# def test_covariance():
137
138
139
@pytest.mark.parametrize("backend", ["minuit"])
140
def test_confidence(backend):
141
    dataset = MyDataset()
142
    fit = Fit(backend=backend)
143
    fit.optimize([dataset])
144
    result = fit.confidence(datasets=[dataset], parameter="x")
145
146
    assert result["success"] is True
147
    assert_allclose(result["errp"], 1)
148
    assert_allclose(result["errn"], 1)
149
150
    # Check that original value state wasn't changed
151
    assert_allclose(dataset.models.parameters["x"].value, 2)
152
153
154
@pytest.mark.parametrize("backend", ["minuit"])
@@ 154-164 (lines=11) @@
151
    assert_allclose(dataset.models.parameters["x"].value, 2)
152
153
154
@pytest.mark.parametrize("backend", ["minuit"])
155
def test_confidence_frozen(backend):
156
    dataset = MyDataset()
157
    dataset.models.parameters["x"].frozen = True
158
    fit = Fit(backend=backend)
159
    fit.optimize([dataset])
160
    result = fit.confidence(datasets=[dataset], parameter="y")
161
162
    assert result["success"] is True
163
    assert_allclose(result["errp"], 1)
164
    assert_allclose(result["errn"], 1)
165
166
167
def test_stat_profile():