Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: fix incorrectly formatted raise statement #911

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions bilby/core/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -1533,8 +1533,7 @@ def get_all_injection_credible_levels(self, keys=None, weights=None):
if keys is None:
keys = self.search_parameter_keys
if self.injection_parameters is None:
raise (
TypeError,
raise TypeError(
"Result object has no 'injection_parameters'. "
"Cannot compute credible levels."
)
Expand Down
5 changes: 4 additions & 1 deletion test/core/result_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,11 @@ def test_get_credible_levels(self):

def test_get_credible_levels_raises_error_if_no_injection_parameters(self):
self.result.injection_parameters = None
with self.assertRaises(TypeError):
with self.assertRaises(TypeError) as error_context:
self.result.get_all_injection_credible_levels()
self.assertTrue(
"Result object has no 'injection_parameters" in str(error_context.exception)
)

def test_kde(self):
kde = self.result.kde
Expand Down
Loading