Skip to content

Commit 8476280

Browse files
authored
Less hacky check for raises (#188)
1 parent 756762d commit 8476280

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

tests/tests.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,8 @@ def test_param_checks(pop_and_params):
7575
pop.params["imf_type"] = 8
7676
# fix the invalid IMF but leave the invalid sf_start > tage
7777
pop.params["imf_type"] = 1
78-
try:
79-
# This *should* still raise an AssertionError
78+
with pytest.raises(AssertionError):
8079
w, s = pop.get_spectrum(tage=pop.params["tage"])
81-
# Hacky way to make sure the AssertionError still got thrown
82-
raise ValueError("Did not throw exception for invalid sf_start > tage")
83-
except(AssertionError):
84-
pass
8580
pop.params["tage"] = 1.0
8681
pop.params["sf_start"] = 0.1
8782
w, s = pop.get_spectrum(tage=pop.params["tage"])

0 commit comments

Comments
 (0)