Skip to content

[Storage] Fixed all errors in next-pylint for azure-storage-file-share#46609

Open
weirongw23-msft wants to merge 8 commits into
Azure:mainfrom
weirongw23-msft:weirongw23/file-share-pylint
Open

[Storage] Fixed all errors in next-pylint for azure-storage-file-share#46609
weirongw23-msft wants to merge 8 commits into
Azure:mainfrom
weirongw23-msft:weirongw23/file-share-pylint

Conversation

@weirongw23-msft
Copy link
Copy Markdown
Member

:)

@weirongw23-msft weirongw23-msft marked this pull request as ready for review April 29, 2026 22:54
Copilot AI review requested due to automatic review settings April 29, 2026 22:54
@github-actions github-actions Bot added the Storage Storage Service (Queues, Blobs, Files) label Apr 29, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR targets azure-storage-file-share’s test/perfstress/sample code to satisfy next-pylint by cleaning up imports, formatting, and a few lint-triggering patterns (e.g., long lines, unused args), plus a handful of small test reliability tweaks (e.g., requests timeouts).

Changes:

  • Reordered/trimmed imports and reformatted long literals/calls across the test suite to address pylint findings.
  • Added/updated several pylint: disable=... directives for known false-positives in test code.
  • Added explicit timeout to some direct requests.* calls in tests.

Reviewed changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
sdk/storage/azure-storage-file-share/tests/test_share_async.py Import/order tweaks; pylint disables; minor formatting.
sdk/storage/azure-storage-file-share/tests/test_share.py Import/order tweaks; pylint disables; minor formatting.
sdk/storage/azure-storage-file-share/tests/test_nfs_async.py Import cleanup/reorder and formatting.
sdk/storage/azure-storage-file-share/tests/test_nfs.py Import cleanup/reorder and formatting.
sdk/storage/azure-storage-file-share/tests/test_helpers_async.py Import reorder; pylint disable on transport import.
sdk/storage/azure-storage-file-share/tests/test_helpers.py Import reorder; pylint disable on transport import.
sdk/storage/azure-storage-file-share/tests/test_handle_async.py Import reorder/spacing changes.
sdk/storage/azure-storage-file-share/tests/test_handle.py Import reorder/spacing changes; minor comprehension simplification.
sdk/storage/azure-storage-file-share/tests/test_get_file_async.py Import reorder; unicode literal cleanup; long literal formatting.
sdk/storage/azure-storage-file-share/tests/test_get_file.py Import reorder; unicode literal cleanup; long literal formatting.
sdk/storage/azure-storage-file-share/tests/test_file_service_properties_async.py Import reorder; loop simplification; pylint disable.
sdk/storage/azure-storage-file-share/tests/test_file_service_properties.py Import reorder; loop simplification; formatting.
sdk/storage/azure-storage-file-share/tests/test_file_client_async.py Import reorder; formatting; pylint disables; test assertions adjusted.
sdk/storage/azure-storage-file-share/tests/test_file_client.py Import reorder; formatting; pylint disables; test assertions adjusted.
sdk/storage/azure-storage-file-share/tests/test_file_async.py Import reorder; formatting; add requests timeouts; removed a test; misc cleanup.
sdk/storage/azure-storage-file-share/tests/test_file_api_version_async.py Import reorder/spacing.
sdk/storage/azure-storage-file-share/tests/test_file_api_version.py Import reorder/spacing.
sdk/storage/azure-storage-file-share/tests/test_file.py Import reorder; formatting; add requests timeouts; removed a test; misc cleanup.
sdk/storage/azure-storage-file-share/tests/test_directory_async.py Import reorder; formatting; unicode/str assertions adjusted.
sdk/storage/azure-storage-file-share/tests/test_directory.py Import reorder; formatting; unicode/str assertions adjusted.
sdk/storage/azure-storage-file-share/tests/settings/testcase.py Removed legacy/unused compatibility imports; added pylint disable for wildcard imports; formatting.
sdk/storage/azure-storage-file-share/tests/perfstress_tests/upload.py Import cleanup/reorder.
sdk/storage/azure-storage-file-share/tests/perfstress_tests/_test_base.py Formatting for long calls/argparse definitions.
sdk/storage/azure-storage-file-share/tests/perfstress_tests/T1_legacy_tests/upload.py Import cleanup (drop unused import).
sdk/storage/azure-storage-file-share/tests/perfstress_tests/T1_legacy_tests/_test_base.py Formatting; pylint disables for legacy patterns/import.
sdk/storage/azure-storage-file-share/tests/encryption_test_helper.py Factor error message into a constant and use it in raises.
sdk/storage/azure-storage-file-share/samples/file_samples_service.py Remove trailing whitespace/newline cleanup.
sdk/storage/azure-storage-file-share/samples/file_samples_client.py Remove trailing whitespace/newline cleanup.
sdk/storage/azure-storage-file-share/samples/file_samples_authentication.py Remove trailing whitespace/newline cleanup.
Comments suppressed due to low confidence (1)

sdk/storage/azure-storage-file-share/tests/test_share.py:88

  • _delete_shares accepts a prefix (and call sites pass a specific share name), but the method ignores it and deletes every share from list_shares. This makes the helper’s behavior non-obvious and can interfere with other tests using the same account. Consider filtering by the provided prefix/name (or remove the parameter and update call sites).
    def _delete_shares(self, prefix=TEST_SHARE_PREFIX):  # pylint: disable=unused-argument
        for l in self.fsc.list_shares(include_snapshots=True):
            try:
                self.fsc.delete_share(l.name, delete_snapshots=True)
            except:
                pass

Comment thread sdk/storage/azure-storage-file-share/tests/test_file_client.py Outdated
Comment thread sdk/storage/azure-storage-file-share/tests/test_share_async.py Outdated
Comment thread sdk/storage/azure-storage-file-share/tests/test_file_client_async.py Outdated
Comment thread sdk/storage/azure-storage-file-share/tests/test_file_async.py Outdated
Comment thread sdk/storage/azure-storage-file-share/tests/test_file.py Outdated
Comment thread sdk/storage/azure-storage-file-share/tests/test_directory_async.py Outdated
Comment thread sdk/storage/azure-storage-file-share/tests/test_directory.py Outdated
Comment thread sdk/storage/azure-storage-file-share/tests/test_file_client.py
Copy link
Copy Markdown
Member

@jalauzon-msft jalauzon-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two comments plus Copilot comments seem mostly good to look at too.

Comment thread sdk/storage/azure-storage-file-share/tests/test_file_service_properties.py Outdated
Comment thread sdk/storage/azure-storage-file-share/tests/test_share.py Outdated
Comment thread sdk/storage/azure-storage-file-share/tests/test_file.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants