File tree Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -361,7 +361,7 @@ def test_import_archive_data_with_invalid_params(
361361 mock_open .return_value .read .return_value = xml_content ()
362362
363363 # Now, we expect a ValueError related to the dtype parameter
364- with pytest .raises (ValueError , match = "You cannot pass dtype to pandas.fwf" ):
364+ with pytest .raises (ValueError , match = r "You cannot pass dtype to pandas.fwf" ):
365365 datadok_extract .import_archive_data (
366366 archive_desc_xml = "mock.xml" ,
367367 archive_file = "mock_archive.txt" ,
@@ -463,7 +463,7 @@ def test_get_path_combinations_with_invalid_dollar_key(
463463
464464 with pytest .raises (
465465 TypeError ,
466- match = "What we got out of the dollar-linux file was not a single string" ,
466+ match = r "What we got out of the dollar-linux file was not a single string" ,
467467 ):
468468 datadok_extract .get_path_combinations ("invalid/path/to/file" )
469469
Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ def test_make_klass_xml_invalid_date_format(tmp_path):
156156 names_bokmaal = ["One" ]
157157 xml_path = tmp_path / "bad_date.xml"
158158
159- with pytest .raises (ValueError , match = "Invalid date format: not-a-date" ):
159+ with pytest .raises (ValueError , match = r "Invalid date format: not-a-date" ):
160160 make_klass_xml_codelist (
161161 path = str (xml_path ),
162162 codes = codes ,
@@ -170,7 +170,7 @@ def test_klass_dataframe_to_xml_unexpected_column(tmp_path):
170170 df = pd .DataFrame ({"kode" : ["1" ], "unexpected_column" : ["oops" ]})
171171 xml_path = tmp_path / "fail.xml"
172172
173- with pytest .raises (ValueError , match = "unexpected_column" ):
173+ with pytest .raises (ValueError , match = r "unexpected_column" ):
174174 klass_dataframe_to_xml_codelist (df , str (xml_path ))
175175
176176
@@ -180,7 +180,7 @@ def test_make_klass_xml_field_length_mismatch(tmp_path):
180180 names_bokmaal = ["One" ]
181181 xml_path = tmp_path / "mismatch.xml"
182182
183- with pytest .raises (ValueError , match = "Length of the entered names must match" ):
183+ with pytest .raises (ValueError , match = r "Length of the entered names must match" ):
184184 make_klass_xml_codelist (
185185 path = str (xml_path ),
186186 codes = codes ,
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ def test_initialization_with_invalid_logger_types(self):
7676 invalid_loggers = [LoggerType .JSONL , 123 , None ]
7777
7878 # Expect a TypeError to be raised
79- with pytest .raises (TypeError , match = "All loggers must be of type LoggerType." ):
79+ with pytest .raises (TypeError , match = r "All loggers must be of type LoggerType." ):
8080 StatLogger (loggers = invalid_loggers )
8181
8282 # JSONL logging creates separate file with JSON formatted logs when enabled
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ def test_find_email_raises_value_error(setup_env):
6464 mock_subprocess .return_value .stdout = "invalid_email"
6565 mock_getuser .return_value = "invalid_user"
6666 with pytest .raises (
67- ValueError , match = "Cant find the users email or tbf in the system."
67+ ValueError , match = r "Cant find the users email or tbf in the system."
6868 ):
6969 find_email ()
7070
You can’t perform that action at this time.
0 commit comments