It feels like `test_fit_sdm_cec_sam()` could be split into two: - Check for expected vs. actual output - Check for exception when the parameters cannot be estimated The code under the `with` statement has no relation with the code above.