pitrou commented on code in PR #44287:
URL: https://github.com/apache/arrow/pull/44287#discussion_r1958279641


##########
python/pyarrow/tests/test_fs.py:
##########
@@ -1466,6 +1466,24 @@ def test_azurefs_options(pickle_module):
     with pytest.raises(TypeError):
         AzureFileSystem()
 
[email protected]
+def test_azurefs_connection_errors(pickle_module):
+    from pyarrow.fs import AzureFileSystem
+
+    # filesystem with bad port - attempts to use this
+    # will lead to transport errors which the FS needs
+    # to handle properly
+    fs1 = AzureFileSystem(
+        account_name='fake-account-name',
+        account_key='fakeaccountkey==',
+        blob_storage_authority='127.0.0.1:20000',
+        dfs_storage_authority='127.0.0.1:20000',
+        blob_storage_scheme='http',
+        dfs_storage_scheme='http'
+    )
+
+    with pytest.raises(OSError):
+        fs1.create_dir("test/dir")

Review Comment:
   I'm not sure the error message is predictable enough for that, but it would 
be nice to match the exception message with a regex:
   ```suggestion
       with pytest.raises(OSError, match='error that happened'):
           fs1.create_dir("test/dir")
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to