mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-23 15:56:45 -04:00
Fix tests which call str() on exception messages
Since Pytest 5, `ExceptionInfo` objects (returned by `pytest.raises`) now have the same `str` representation as `repr`. This means that `str(e)` now needs to be changed to `str(e.value)`. https://github.com/pytest-dev/pytest/issues/5412
This commit is contained in:
@@ -503,7 +503,7 @@ def test_dao_fetch_live_services_data(sample_user):
|
||||
def test_get_service_by_id_returns_none_if_no_service(notify_db):
|
||||
with pytest.raises(NoResultFound) as e:
|
||||
dao_fetch_service_by_id(str(uuid.uuid4()))
|
||||
assert 'No row was found for one()' in str(e)
|
||||
assert 'No row was found for one()' in str(e.value)
|
||||
|
||||
|
||||
def test_get_service_by_id_returns_service(notify_db_session):
|
||||
|
||||
Reference in New Issue
Block a user