File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -272,8 +272,9 @@ def test_direct_setup_import(mock_setup):
272272 with mock .patch ("builtins.open" ) as mock_open :
273273 # Configure the mock to return appropriate content for different files
274274 def side_effect (filename , * args , ** kwargs ):
275+ filename_str = str (filename ) # Convert PosixPath to string
275276 for mock_path , content in mock_file_contents .items ():
276- if filename .endswith (mock_path ):
277+ if filename_str .endswith (mock_path ):
277278 file_mock = mock .MagicMock ()
278279 file_mock .__enter__ .return_value .read .return_value = content
279280 return file_mock
@@ -385,8 +386,9 @@ def test_version_info_not_found_error():
385386 with mock .patch ("builtins.open" ) as mock_open :
386387 # Configure mock to return appropriate content for different files
387388 def side_effect (filename , * args , ** kwargs ):
389+ filename_str = str (filename ) # Convert PosixPath to string
388390 for mock_path , content in mock_file_contents .items ():
389- if filename .endswith (mock_path ):
391+ if filename_str .endswith (mock_path ):
390392 file_mock = mock .MagicMock ()
391393 file_mock .__enter__ .return_value .read .return_value = content
392394 return file_mock
You can’t perform that action at this time.
0 commit comments