mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 01:11:38 -05: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:
@@ -686,7 +686,7 @@ def test_process_letter_task_check_virus_scan_failed(sample_letter_notification,
|
||||
with pytest.raises(VirusScanError) as e:
|
||||
process_virus_scan_failed(filename)
|
||||
|
||||
assert "Virus scan failed:" in str(e)
|
||||
assert "Virus scan failed:" in str(e.value)
|
||||
mock_move_failed_pdf.assert_called_once_with(filename, ScanErrorType.FAILURE)
|
||||
assert sample_letter_notification.status == NOTIFICATION_VIRUS_SCAN_FAILED
|
||||
|
||||
|
||||
Reference in New Issue
Block a user