mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-22 08:21:13 -05:00
Fix assertions when we catch an error in the tests
Code that is within a `with Python.raises(...)` context manager but comes after the line that raises the exception doesn't get evaluated. We had some assertions that we never being tested because of this, so this ensures that they will always get run and fixes them where necessary.
This commit is contained in:
@@ -194,7 +194,7 @@ def test_update_status_of_notifications_after_timeout(notify_api, sample_templat
|
||||
seconds=current_app.config.get('SENDING_NOTIFICATIONS_TIMEOUT_PERIOD') + 10))
|
||||
with pytest.raises(NotificationTechnicalFailureException) as e:
|
||||
timeout_notifications()
|
||||
assert str(not2.id) in e.value
|
||||
assert str(not2.id) in str(e.value)
|
||||
assert not1.status == 'temporary-failure'
|
||||
assert not2.status == 'technical-failure'
|
||||
assert not3.status == 'temporary-failure'
|
||||
|
||||
Reference in New Issue
Block a user