Example #1
0
    def test_set_params(self, teardown):
        step = DummyEstimator()

        new_params_wrong = {"non_existent_param": 42}
        with pytest.raises(ValueError):
            step.set_params(**new_params_wrong)

        new_params = {"x": 456}
        step.set_params(**new_params)
        params = step.get_params()
        expected = {"x": 456, "y": "abc"}
        assert params == expected
Example #2
0
 def test_get_params(self, teardown):
     step = DummyEstimator()
     params = step.get_params()
     expected = {"x": 123, "y": "abc"}
     assert params == expected