@@ -54,7 +54,7 @@ def test_generate_bulk_actions_delete():
5454def test_generate_bulk_actions_invalid_action_raises_error ():
5555 records = [{"timdex_record_id" : "12345" , "other_fields" : "some_data" }]
5656 actions = helpers .generate_bulk_actions ("test-index" , records , "wrong" )
57- with pytest .raises (ValueError , match = "Invalid action parameter" ):
57+ with pytest .raises (ValueError , match = r "Invalid action parameter" ):
5858 next (actions )
5959
6060
@@ -70,14 +70,15 @@ def test_validate_bulk_cli_options_neither_index_nor_source_passed(
7070 test_opensearch_client ,
7171):
7272 with pytest .raises (
73- UsageError , match = "Must provide either an existing index name or a valid source."
73+ UsageError , match = r "Must provide either an existing index name or a valid source."
7474 ):
7575 helpers .validate_bulk_cli_options (None , None , test_opensearch_client )
7676
7777
7878def test_validate_bulk_cli_options_index_and_source_passed (test_opensearch_client ):
7979 with pytest .raises (
80- UsageError , match = "Only one of --index and --source options is allowed, not both."
80+ UsageError ,
81+ match = r"Only one of --index and --source options is allowed, not both." ,
8182 ):
8283 helpers .validate_bulk_cli_options (
8384 "index-name" , "source-name" , test_opensearch_client
@@ -87,7 +88,7 @@ def test_validate_bulk_cli_options_index_and_source_passed(test_opensearch_clien
8788@my_vcr .use_cassette ("helpers/bulk_cli_nonexistent_index.yaml" )
8889def test_validate_bulk_cli_options_nonexistent_index_passed (test_opensearch_client ):
8990 with pytest .raises (
90- BadParameter , match = "Index 'wrong' does not exist in the cluster."
91+ BadParameter , match = r "Index 'wrong' does not exist in the cluster."
9192 ):
9293 helpers .validate_bulk_cli_options ("wrong" , None , test_opensearch_client )
9394
@@ -97,8 +98,8 @@ def test_validate_bulk_cli_options_no_primary_index_for_source(test_opensearch_c
9798 with pytest .raises (
9899 BadParameter ,
99100 match = (
100- "No index name was passed and there is no "
101- "primary-aliased index for source 'dspace'."
101+ r "No index name was passed and there is no "
102+ r "primary-aliased index for source 'dspace'."
102103 ),
103104 ):
104105 helpers .validate_bulk_cli_options (None , "dspace" , test_opensearch_client )
0 commit comments