diff --git a/tests/app/main/views/test_history.py b/tests/app/main/views/test_history.py index 2535e24fd..184e0b061 100644 --- a/tests/app/main/views/test_history.py +++ b/tests/app/main/views/test_history.py @@ -5,8 +5,8 @@ from tests.conftest import SERVICE_ONE_ID, normalize_spaces @pytest.mark.parametrize( - "extra_args, expected_headings_and_events", - ( + ("extra_args", "expected_headings_and_events"), + [ ( {}, [ @@ -83,7 +83,7 @@ from tests.conftest import SERVICE_ONE_ID, normalize_spaces ), ], ), - ), + ], ) @freeze_time("2012-01-01 01:01:01") def test_history( diff --git a/tests/app/main/views/test_index.py b/tests/app/main/views/test_index.py index 405efc6fd..e9ea4dcf0 100644 --- a/tests/app/main/views/test_index.py +++ b/tests/app/main/views/test_index.py @@ -60,8 +60,8 @@ def test_robots(client_request): @pytest.mark.parametrize( - "endpoint, kwargs", - ( + ("endpoint", "kwargs"), + [ ("sign_in", {}), ("support", {}), ("support_public", {}), @@ -73,7 +73,7 @@ def test_robots(client_request): ("thanks", {}), ("register", {}), pytest.param("index", {}, marks=pytest.mark.xfail(raises=AssertionError)), - ), + ], ) @freeze_time("2012-12-12 12:12") # So we don’t go out of business hours def test_hiding_pages_from_search_engines( @@ -170,12 +170,11 @@ def test_guidance_pages_link_to_service_pages_when_signed_in( @pytest.mark.parametrize( - "view, expected_view", + ("view", "expected_view"), [ ("information_risk_management", "security"), ("old_integration_testing", "integration_testing"), ("old_roadmap", "roadmap"), - ("information_risk_management", "security"), ("old_terms", "terms"), ("information_security", "using_notify"), ("old_using_notify", "using_notify"), @@ -265,8 +264,8 @@ def test_css_is_served_from_correct_path(client_request): @pytest.mark.parametrize( - "extra_args, email_branding_retrieved", - ( + ("extra_args", "email_branding_retrieved"), + [ ( {}, False, @@ -279,7 +278,7 @@ def test_css_is_served_from_correct_path(client_request): {"branding_style": sample_uuid()}, True, ), - ), + ], ) def test_email_branding_preview( client_request, @@ -294,7 +293,12 @@ def test_email_branding_preview( assert mock_get_email_branding.called is email_branding_retrieved -@pytest.mark.parametrize("current_date, expected_rate", (("2022-05-01", "1.72"),)) +@pytest.mark.parametrize( + ("current_date", "expected_rate"), + [ + ("2022-05-01", "1.72"), + ], +) @pytest.mark.skip(reason="Currently hidden for TTS") def test_sms_price( client_request, diff --git a/tests/app/main/views/test_jobs.py b/tests/app/main/views/test_jobs.py index 8ad57a1f0..a4f72a318 100644 --- a/tests/app/main/views/test_jobs.py +++ b/tests/app/main/views/test_jobs.py @@ -37,7 +37,7 @@ def test_old_jobs_hub_redirects( ], ) @pytest.mark.parametrize( - "status_argument, expected_api_call", + ("status_argument", "expected_api_call"), [ ( "", @@ -247,8 +247,8 @@ def test_should_show_job_with_sending_limit_exceeded_status( @freeze_time("2020-01-10 1:0:0") @pytest.mark.parametrize( - "created_at, processing_started, expected_message", - ( + ("created_at", "processing_started", "expected_message"), + [ # Recently created, not yet started (datetime(2020, 1, 10, 0, 0, 0), None, ("No messages to show yet…")), # Just started @@ -284,7 +284,7 @@ def test_should_show_job_with_sending_limit_exceeded_status( "These messages have been deleted because they were sent more than 7 days ago" ), ), - ), + ], ) def test_should_show_old_job( client_request, @@ -469,7 +469,7 @@ def test_should_show_updates_for_scheduled_job_as_json( @pytest.mark.parametrize( - "job_created_at, expected_message", + ("job_created_at", "expected_message"), [ ("2016-01-10 11:09:00.000000+00:00", "Data available for 7 days"), ("2016-01-04 11:09:00.000000+00:00", "Data available for 1 day"), diff --git a/tests/app/main/views/test_manage_users.py b/tests/app/main/views/test_manage_users.py index 6d7278d07..99d273ab8 100644 --- a/tests/app/main/views/test_manage_users.py +++ b/tests/app/main/views/test_manage_users.py @@ -20,8 +20,8 @@ from tests.conftest import ( ) -@pytest.mark.parametrize( - "user, expected_self_text, expected_coworker_text", +@pytest.mark.parametrize( # noqa: PT014 # Duplicate parameters have different permissions. + ("user", "expected_self_text", "expected_coworker_text"), [ ( create_active_user_with_permissions(), @@ -174,10 +174,10 @@ def test_should_show_overview_page( @pytest.mark.parametrize( "state", - ( + [ "active", "pending", - ), + ], ) def test_should_show_change_details_link( client_request, @@ -220,10 +220,10 @@ def test_should_show_change_details_link( @pytest.mark.parametrize( "number_of_users", - ( + [ pytest.param(7), pytest.param(8), - ), + ], ) def test_should_show_live_search_if_more_than_7_users( client_request, @@ -324,7 +324,7 @@ def test_should_show_caseworker_on_overview_page( @pytest.mark.parametrize( - "endpoint, extra_args, service_has_email_auth, auth_options_hidden", + ("endpoint", "extra_args", "service_has_email_auth", "auth_options_hidden"), [ ("main.edit_user_permissions", {"user_id": sample_uuid()}, True, False), ("main.edit_user_permissions", {"user_id": sample_uuid()}, False, True), @@ -350,9 +350,9 @@ def test_service_with_no_email_auth_hides_auth_type_options( ) == auth_options_hidden -@pytest.mark.parametrize("service_has_caseworking", (True, False)) +@pytest.mark.parametrize("service_has_caseworking", [True, False]) @pytest.mark.parametrize( - "endpoint, extra_args", + ("endpoint", "extra_args"), [ ( "main.edit_user_permissions", @@ -385,7 +385,7 @@ def test_service_without_caseworking_doesnt_show_admin_vs_caseworker( @pytest.mark.parametrize( - "service_has_email_auth, displays_auth_type", [(True, True), (False, False)] + ("service_has_email_auth", "displays_auth_type"), [(True, True), (False, False)] ) def test_manage_users_page_shows_member_auth_type_if_service_has_email_auth_activated( client_request, @@ -403,7 +403,7 @@ def test_manage_users_page_shows_member_auth_type_if_service_has_email_auth_acti @pytest.mark.parametrize( - "sms_option_disabled, mobile_number, expected_label", + ("sms_option_disabled", "mobile_number", "expected_label"), [ ( True, @@ -455,7 +455,7 @@ def test_user_with_no_mobile_number_cant_be_set_to_sms_auth( @pytest.mark.parametrize( - "endpoint, extra_args, expected_checkboxes", + ("endpoint", "extra_args", "expected_checkboxes"), [ ( "main.edit_user_permissions", @@ -542,7 +542,7 @@ def test_should_not_show_page_for_non_team_member( @pytest.mark.parametrize( - "submitted_permissions, permissions_sent_to_api", + ("submitted_permissions", "permissions_sent_to_api"), [ ( { @@ -1045,7 +1045,7 @@ def test_should_show_folder_permission_form_if_service_has_folder_permissions_en @pytest.mark.parametrize( - "email_address, gov_user", + ("email_address", "gov_user"), [("test@example.gsa.gov", True), ("test@example.com", False)], ) def test_invite_user( @@ -1151,7 +1151,7 @@ def test_invite_user_when_email_address_is_prefilled( @pytest.mark.parametrize("auth_type", [("sms_auth"), ("email_auth")]) @pytest.mark.parametrize( - "email_address, gov_user", + ("email_address", "gov_user"), [("test@example.gsa.gov", True), ("test@example.com", False)], ) def test_invite_user_with_email_auth_service( @@ -1267,7 +1267,7 @@ def test_cancel_invited_user_doesnt_work_if_user_not_invited_to_this_service( @pytest.mark.parametrize( - "invite_status, expected_text", + ("invite_status", "expected_text"), [ ( "pending", @@ -1385,7 +1385,7 @@ def test_no_permission_manage_users_page( @pytest.mark.parametrize( - "folders_user_can_see, expected_message", + ("folders_user_can_see", "expected_message"), [ (3, "Can see all folders"), (2, "Can see 2 folders"), diff --git a/tests/app/main/views/test_notifications.py b/tests/app/main/views/test_notifications.py index 875db4ccc..3f522ae83 100644 --- a/tests/app/main/views/test_notifications.py +++ b/tests/app/main/views/test_notifications.py @@ -14,7 +14,7 @@ from tests.conftest import ( @pytest.mark.parametrize( - "key_type, notification_status, expected_status", + ("key_type", "notification_status", "expected_status"), [ (None, "created", "Sending"), ( @@ -87,7 +87,7 @@ def test_notification_status_page_shows_details( @pytest.mark.parametrize( - "notification_type, notification_status, expected_class", + ("notification_type", "notification_status", "expected_class"), [ ("sms", "failed", "error"), ("email", "failed", "error"), @@ -130,7 +130,7 @@ def test_notification_status_page_formats_email_and_sms_status_correctly( @pytest.mark.parametrize( - "template_redaction_setting, expected_content", + ("template_redaction_setting", "expected_content"), [ (False, "service one: hello Jo"), (True, "service one: hello hidden"), @@ -170,7 +170,7 @@ def test_notification_status_page_respects_redaction( @pytest.mark.parametrize( - "extra_args, expected_back_link", + ("extra_args", "expected_back_link"), [ ( {}, @@ -222,8 +222,8 @@ def test_notification_status_shows_expected_back_link( @pytest.mark.parametrize( - "time_of_viewing_page, expected_message", - ( + ("time_of_viewing_page", "expected_message"), + [ ( "2012-01-01 06:01", ("‘sample template’ was sent by Test User today at 06:01 UTC"), @@ -240,7 +240,7 @@ def test_notification_status_shows_expected_back_link( "2013-01-03 06:01", ("‘sample template’ was sent by Test User on 1 January 2012 at 06:01 UTC"), ), - ), + ], ) def test_notification_page_doesnt_link_to_template_in_tour( mocker, @@ -295,7 +295,7 @@ def test_notification_page_does_not_show_cancel_link_for_sms_or_email_notificati @pytest.mark.parametrize( - "service_permissions, template_type, link_expected", + ("service_permissions", "template_type", "link_expected"), [ ([], "", False), (["inbound_sms"], "email", False), diff --git a/tests/app/main/views/test_platform_admin.py b/tests/app/main/views/test_platform_admin.py index 7b3990901..b3859024e 100644 --- a/tests/app/main/views/test_platform_admin.py +++ b/tests/app/main/views/test_platform_admin.py @@ -52,7 +52,7 @@ def test_should_403_if_not_platform_admin( @pytest.mark.parametrize( - "endpoint, expected_services_shown", + ("endpoint", "expected_services_shown"), [ ("main.live_services", 1), ("main.trial_services", 1), @@ -87,7 +87,7 @@ def test_should_render_platform_admin_page( ], ) @pytest.mark.parametrize( - "partial_url_for, inc", + ("partial_url_for", "inc"), [ (partial(url_for), True), (partial(url_for, include_from_test_key="y", start_date="", end_date=""), True), @@ -137,7 +137,7 @@ def test_live_trial_services_with_date_filter( @pytest.mark.parametrize( - "endpoint, expected_big_numbers", + ("endpoint", "expected_big_numbers"), [ ( "main.live_services", @@ -263,7 +263,7 @@ def test_format_stats_by_service_returns_correct_values(fake_uuid): @pytest.mark.parametrize( - "endpoint, restricted, research_mode", + ("endpoint", "restricted", "research_mode"), [("main.trial_services", True, False), ("main.live_services", False, False)], ) def test_should_show_email_and_sms_stats_for_all_service_types( @@ -311,7 +311,7 @@ def test_should_show_email_and_sms_stats_for_all_service_types( @pytest.mark.parametrize( - "endpoint, restricted", + ("endpoint", "restricted"), [("main.live_services", False), ("main.trial_services", True)], ids=["live", "trial"], ) @@ -363,7 +363,7 @@ def test_should_show_archived_services_last( @pytest.mark.parametrize( - "endpoint, restricted, research_mode", + ("endpoint", "restricted", "research_mode"), [("main.trial_services", True, False), ("main.live_services", False, False)], ) def test_should_order_services_by_usage_with_inactive_last( @@ -561,7 +561,7 @@ def test_platform_admin_list_complaints_returns_404_with_invalid_page( @pytest.mark.parametrize( - "number, total, threshold, result", + ("number", "total", "threshold", "result"), [ (0, 0, 0, False), (1, 1, 0, True), @@ -763,8 +763,8 @@ def test_clear_cache_shows_form( @pytest.mark.parametrize( - "model_type, expected_calls, expected_confirmation", - ( + ("model_type", "expected_calls", "expected_confirmation"), + [ ( "template", [ @@ -793,7 +793,7 @@ def test_clear_cache_shows_form( ], "Removed 18 objects across 9 key formats for service, organization", ), - ), + ], ) def test_clear_cache_submits_and_tells_you_how_many_things_were_deleted( client_request, diff --git a/tests/app/main/views/test_providers.py b/tests/app/main/views/test_providers.py index 482e120e4..d3a79599f 100644 --- a/tests/app/main/views/test_providers.py +++ b/tests/app/main/views/test_providers.py @@ -26,7 +26,7 @@ def provider_json(overrides): return provider -@pytest.fixture +@pytest.fixture() def sms_provider_1(): return provider_json( { @@ -42,7 +42,7 @@ def sms_provider_1(): ) -@pytest.fixture +@pytest.fixture() def sms_provider_2(): return provider_json( { @@ -56,7 +56,7 @@ def sms_provider_2(): ) -@pytest.fixture +@pytest.fixture() def email_provider_1(): return provider_json( { @@ -68,7 +68,7 @@ def email_provider_1(): ) -@pytest.fixture +@pytest.fixture() def email_provider_2(): return provider_json( { @@ -80,7 +80,7 @@ def email_provider_2(): ) -@pytest.fixture +@pytest.fixture() def sms_provider_intl_1(): return provider_json( { @@ -94,7 +94,7 @@ def sms_provider_intl_1(): ) -@pytest.fixture +@pytest.fixture() def sms_provider_intl_2(): return provider_json( { @@ -108,7 +108,7 @@ def sms_provider_intl_2(): ) -@pytest.fixture +@pytest.fixture() def stub_providers( sms_provider_1, sms_provider_2, @@ -129,7 +129,7 @@ def stub_providers( } -@pytest.fixture +@pytest.fixture() def stub_provider_history(): return { "data": [ @@ -365,7 +365,7 @@ def test_edit_sms_provider_provider_ratio_only_shows_active_providers( @pytest.mark.parametrize( - "post_data, expected_calls", + ("post_data", "expected_calls"), [ ( {"sms_provider_1": 10, "sms_provider_2": 90}, @@ -407,7 +407,7 @@ def test_edit_sms_provider_ratio_submit( @pytest.mark.parametrize( - "post_data, expected_error", + ("post_data", "expected_error"), [ ({"sms_provider_1": 90, "sms_provider_2": 20}, "Must add up to 100%"), ({"sms_provider_1": 101, "sms_provider_2": 20}, "Must be between 0 and 100"), diff --git a/tests/app/main/views/test_register.py b/tests/app/main/views/test_register.py index bc6a7b4a6..fc3d24ffa 100644 --- a/tests/app/main/views/test_register.py +++ b/tests/app/main/views/test_register.py @@ -142,10 +142,10 @@ def test_should_return_200_when_email_is_not_gov_uk( @pytest.mark.parametrize( "email_address", - ( + [ "notfound@example.gsa.gov", "example@lsquo.net", - ), + ], ) def test_should_add_user_details_to_session( client_request, @@ -215,7 +215,7 @@ def test_register_with_existing_email_sends_emails( @pytest.mark.parametrize( - "email_address, expected_value", + ("email_address", "expected_value"), [ ("first.last@example.com", "First Last"), ("first.middle.last@example.com", "First Middle Last"), @@ -281,13 +281,13 @@ def test_shows_hidden_email_address_on_registration_page_from_invite( @pytest.mark.parametrize( "extra_data", - ( + [ {}, # The username field is present in the page but the POST request # should ignore it {"username": "invited@user.com"}, {"username": "anythingelse@example.com"}, - ), + ], ) def test_register_from_invite( client_request, diff --git a/tests/app/main/views/test_send.py b/tests/app/main/views/test_send.py index 69e68e882..674f2dbd6 100644 --- a/tests/app/main/views/test_send.py +++ b/tests/app/main/views/test_send.py @@ -163,7 +163,7 @@ def test_sms_sender_has_receives_replies_hint( @pytest.mark.parametrize( - "template_type, sender_data", + ("template_type", "sender_data"), [ ( "email", @@ -336,7 +336,7 @@ def test_example_spreadsheet( @pytest.mark.parametrize( - "filename, acceptable_file, expected_status", + ("filename", "acceptable_file", "expected_status"), list(zip(test_spreadsheet_files, repeat(True), repeat(302))) + list(zip(test_non_spreadsheet_files, repeat(False), repeat(200))), ) @@ -412,7 +412,7 @@ def test_send_messages_sanitises_and_truncates_file_name_for_metadata( @pytest.mark.parametrize( - "exception, expected_error_message", + ("exception", "expected_error_message"), [ ( partial(UnicodeDecodeError, "codec", b"", 1, 2, "reason"), @@ -641,7 +641,7 @@ def test_upload_csv_file_with_very_long_placeholder_shows_check_page_with_errors @pytest.mark.parametrize( - "file_contents, expected_error,", + ("file_contents", "expected_error"), [ ( """ @@ -819,7 +819,12 @@ def test_upload_valid_csv_redirects_to_check_page( @pytest.mark.parametrize( - "extra_args, expected_link_in_first_row, expected_recipient, expected_message", + ( + "extra_args", + "expected_link_in_first_row", + "expected_recipient", + "expected_message", + ), [ ( {}, @@ -995,7 +1000,7 @@ def test_show_all_columns_if_there_are_duplicate_recipient_columns( @pytest.mark.parametrize( - "row_index, expected_status", + ("row_index", "expected_status"), [ (0, 404), (1, 404), @@ -1108,10 +1113,10 @@ def test_send_one_off_does_not_send_without_the_correct_permissions( @pytest.mark.parametrize( "user", - ( + [ create_active_user_with_permissions(), create_active_caseworking_user(), - ), + ], ) def test_send_one_off_has_correct_page_title( client_request, @@ -1143,7 +1148,7 @@ def test_send_one_off_has_correct_page_title( @pytest.mark.parametrize( - "step_index, prefilled, expected_field_label", + ("step_index", "prefilled", "expected_field_label"), [ ( 0, @@ -1186,7 +1191,7 @@ def test_send_one_off_shows_placeholders_in_correct_order( @pytest.mark.parametrize( - "user, template_type, expected_link_text, expected_link_url", + ("user", "template_type", "expected_link_text", "expected_link_url"), [ ( create_active_user_with_permissions(), @@ -1244,7 +1249,7 @@ def test_send_one_off_has_skip_link( @pytest.mark.parametrize( - "template_type, expected_sticky", + ("template_type", "expected_sticky"), [ ("sms", False), ("email", True), @@ -1277,10 +1282,10 @@ def test_send_one_off_has_sticky_header_for_email( @pytest.mark.parametrize( "user", - ( + [ create_active_user_with_permissions(), create_active_caseworking_user(), - ), + ], ) def test_skip_link_will_not_show_on_sms_one_off_if_service_has_no_mobile_number( client_request, @@ -1310,10 +1315,10 @@ def test_skip_link_will_not_show_on_sms_one_off_if_service_has_no_mobile_number( @pytest.mark.parametrize( "user", - ( + [ create_active_user_with_permissions(), create_active_caseworking_user(), - ), + ], ) def test_send_one_off_offers_link_to_upload( client_request, @@ -1378,10 +1383,10 @@ def test_send_one_off_has_link_to_use_existing_list( @pytest.mark.parametrize( "user", - ( + [ create_active_user_with_permissions(), create_active_caseworking_user(), - ), + ], ) def test_link_to_upload_not_offered_when_entering_personalisation( client_request, @@ -1413,10 +1418,10 @@ def test_link_to_upload_not_offered_when_entering_personalisation( @pytest.mark.parametrize( "user", - ( + [ create_active_user_with_permissions(), create_active_caseworking_user(), - ), + ], ) def test_send_one_off_redirects_to_end_if_step_out_of_bounds( client_request, @@ -1448,10 +1453,10 @@ def test_send_one_off_redirects_to_end_if_step_out_of_bounds( @pytest.mark.parametrize( "user", - ( + [ create_active_user_with_permissions(), create_active_caseworking_user(), - ), + ], ) def test_send_one_off_redirects_to_start_if_you_skip_steps( client_request, @@ -1483,10 +1488,10 @@ def test_send_one_off_redirects_to_start_if_you_skip_steps( @pytest.mark.parametrize( "user", - ( + [ create_active_user_with_permissions(), create_active_caseworking_user(), - ), + ], ) def test_send_one_off_redirects_to_start_if_index_out_of_bounds_and_some_placeholders_empty( client_request, @@ -1520,10 +1525,10 @@ def test_send_one_off_redirects_to_start_if_index_out_of_bounds_and_some_placeho @pytest.mark.parametrize( "user", - ( + [ create_active_user_with_permissions(), create_active_caseworking_user(), - ), + ], ) def test_send_one_off_sms_message_redirects( client_request, @@ -1552,10 +1557,10 @@ def test_send_one_off_sms_message_redirects( @pytest.mark.parametrize( "user", - ( + [ create_active_user_with_permissions(), create_active_caseworking_user(), - ), + ], ) def test_send_one_off_email_to_self_without_placeholders_redirects_to_check_page( client_request, @@ -1587,8 +1592,8 @@ def test_send_one_off_email_to_self_without_placeholders_redirects_to_check_page @pytest.mark.parametrize( - "permissions, expected_back_link_endpoint, extra_args", - ( + ("permissions", "expected_back_link_endpoint", "extra_args"), + [ ( {"send_messages", "manage_templates"}, "main.view_template", @@ -1604,7 +1609,7 @@ def test_send_one_off_email_to_self_without_placeholders_redirects_to_check_page "main.choose_template", {}, ), - ), + ], ) def test_send_one_off_step_0_back_link( client_request, @@ -1819,7 +1824,7 @@ def test_upload_csvfile_with_valid_phone_shows_all_numbers( @pytest.mark.parametrize( - "international_sms_permission, should_allow_international", + ("international_sms_permission", "should_allow_international"), [ (False, False), (True, True), @@ -1975,7 +1980,7 @@ def test_create_job_should_call_api( @pytest.mark.parametrize( - "route, response_code", + ("route", "response_code"), [ ("main.send_messages", 200), ("main.get_example_csv", 200), @@ -2011,7 +2016,7 @@ def test_route_permissions( @pytest.mark.parametrize( - "route, response_code, method", + ("route", "response_code", "method"), [("main.check_notification", 200, "GET"), ("main.send_notification", 302, "POST")], ) def test_route_permissions_send_check_notifications( @@ -2043,7 +2048,7 @@ def test_route_permissions_send_check_notifications( @pytest.mark.parametrize( - "route, expected_status", + ("route", "expected_status"), [ ("main.send_messages", 403), ("main.get_example_csv", 403), @@ -2083,7 +2088,7 @@ def test_route_permissions_sending( @pytest.mark.parametrize( - "template_type, has_placeholders, extra_args, expected_url", + ("template_type", "has_placeholders", "extra_args", "expected_url"), [ ("sms", False, dict(), partial(url_for, ".send_messages")), ("sms", True, dict(), partial(url_for, ".send_messages")), @@ -2142,7 +2147,7 @@ def test_check_messages_back_link( @pytest.mark.parametrize( - "num_requested,expected_msg", + ("num_requested", "expected_msg"), [ (None, "‘example.csv’ contains 1,234 phone numbers."), ("0", "‘example.csv’ contains 1,234 phone numbers."), @@ -2245,10 +2250,10 @@ def test_check_messages_shows_trial_mode_error( @pytest.mark.parametrize( "uploaded_file_name", - ( + [ pytest.param("applicants.ods"), # normal job pytest.param("send_me_later.csv"), # should look at scheduled job - ), + ], ) def test_warns_if_file_sent_already( client_request, @@ -2289,10 +2294,10 @@ def test_warns_if_file_sent_already( @pytest.mark.parametrize( "uploaded_file_name", - ( + [ pytest.param("thisisatest.csv"), # different template version pytest.param("full_of_regret.csv"), # job is cancelled - ), + ], ) def test_warns_if_file_sent_already_errors( client_request, @@ -2315,7 +2320,9 @@ def test_warns_if_file_sent_already_errors( return_value={"original_file_name": uploaded_file_name}, ) # Should be botocore.errorfactory.NoSuchKey but for some reason can't use that - with pytest.raises(expected_exception=Exception): + with pytest.raises( # noqa: PT011,PT012 # Requires more research on how to refactor. + expected_exception=Exception + ): page = client_request.get( "main.check_messages", service_id=SERVICE_ONE_ID, @@ -2516,8 +2523,8 @@ def test_check_notification_shows_preview( @pytest.mark.parametrize( - "template, recipient, placeholders, expected_personalisation", - ( + ("template", "recipient", "placeholders", "expected_personalisation"), + [ ( mock_get_service_template, "2028675301", @@ -2530,7 +2537,7 @@ def test_check_notification_shows_preview( {}, {}, ), - ), + ], ) def test_send_notification_submits_data( client_request, @@ -2609,7 +2616,7 @@ def test_send_notification_redirects_if_missing_data( @pytest.mark.parametrize( - "extra_args, extra_redirect_args", [({}, {}), ({"help": "3"}, {"help": "3"})] + ("extra_args", "extra_redirect_args"), [({}, {}), ({"help": "3"}, {"help": "3"})] ) def test_send_notification_redirects_to_view_page( client_request, @@ -2647,7 +2654,7 @@ SERVICE_DAILY_LIMIT_MSG = "Exceeded send limits (1000) for today" @pytest.mark.parametrize( - "exception_msg, expected_h1, expected_err_details", + ("exception_msg", "expected_h1", "expected_err_details"), [ ( TRIAL_MODE_MSG, @@ -2736,7 +2743,7 @@ def test_send_notification_shows_email_error_in_trial_mode( @pytest.mark.parametrize( - "endpoint, extra_args", + ("endpoint", "extra_args"), [ ("main.check_messages", {"template_id": uuid4(), "upload_id": uuid4()}), ("main.send_one_off_step", {"template_id": uuid4(), "step_index": 0}), @@ -2791,7 +2798,7 @@ def test_reply_to_is_previewed_if_chosen( @pytest.mark.parametrize( - "endpoint, extra_args", + ("endpoint", "extra_args"), [ ("main.check_messages", {"template_id": uuid4(), "upload_id": uuid4()}), ("main.send_one_off_step", {"template_id": uuid4(), "step_index": 0}),