Skip to content

Commit

Permalink
Merge pull request #676 from mwcraig/fix-pytest-thing
Browse files Browse the repository at this point in the history
Use correct method to access content of error message in pytest
  • Loading branch information
crawfordsm committed Jul 25, 2019
2 parents 8f91e1d + 7ce4740 commit 5de14c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ccdproc/tests/test_ccdproc.py
Expand Up @@ -424,7 +424,7 @@ def test_unit_mismatch_behaves_as_expected(ccd_data):
ccd_data.subtract(bad_unit)

# Was the error message as expected?
assert expected_message in str(e)
assert expected_message in str(e.value)

# test for flat correction
@pytest.mark.data_scale(10)
Expand Down Expand Up @@ -511,7 +511,7 @@ def test_flat_correct_norm_value_bad_value(ccd_data):
flat = CCDData(data, meta=fits.Header(), unit=ccd_data.unit)
with pytest.raises(ValueError) as e:
flat_correct(ccd_data, flat, add_keyword=None, norm_value=-7)
assert "norm_value must be" in str(e)
assert "norm_value must be" in str(e.value)


# test for deviation and for flat correction
Expand Down

0 comments on commit 5de14c7

Please sign in to comment.