From f7a7868b33d8c0ffc5e0dc7606b8795cecfdbbc5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 4 Oct 2023 09:55:36 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- datashuttle/utils/folders.py | 1 - datashuttle/utils/formatting.py | 1 - tests/tests_integration/test_formatting.py | 3 --- 3 files changed, 5 deletions(-) diff --git a/datashuttle/utils/folders.py b/datashuttle/utils/folders.py index 3866d49ea..773a071ab 100644 --- a/datashuttle/utils/folders.py +++ b/datashuttle/utils/folders.py @@ -508,7 +508,6 @@ def search_filesystem_path_for_folders( all_folder_names = [] all_filenames = [] for file_or_folder in glob.glob(search_path_with_prefix.as_posix()): - if os.path.isdir(file_or_folder): all_folder_names.append(os.path.basename(file_or_folder)) else: diff --git a/datashuttle/utils/formatting.py b/datashuttle/utils/formatting.py index 1e1827fdc..a91f3314c 100644 --- a/datashuttle/utils/formatting.py +++ b/datashuttle/utils/formatting.py @@ -385,7 +385,6 @@ def warn_on_inconsistent_sub_or_ses_leading_zeros( ) for fail_name in failing_cases: - message = ( f"Inconsistent number of leading zeros for " f"{fail_name} names in the project found. It is crucial " diff --git a/tests/tests_integration/test_formatting.py b/tests/tests_integration/test_formatting.py index 23444f85d..3e50ebc04 100644 --- a/tests/tests_integration/test_formatting.py +++ b/tests/tests_integration/test_formatting.py @@ -125,7 +125,6 @@ def test_warning_non_consecutive_numbers(self, project): def test_warn_on_inconsistent_leading_zeros_subjects( self, project, bad_sub_name ): - project.make_sub_folders( ["sub-001", "sub-010", "sub-100_date-20221314", "sub-1000"], ["ses-001_id-1231"], @@ -165,7 +164,6 @@ def test_warn_on_inconsistent_leading_zeros_sessions( def run_warn_on_consistentent_leading_zeros_sub_or_ses( self, project, sub_name, ses_name ): - with warnings.catch_warnings(): warnings.simplefilter("error") project._show_pre_transfer_messages() @@ -180,7 +178,6 @@ def run_warn_on_consistentent_leading_zeros_sub_or_ses( self.check_inconsistent_sub_or_ses_level_warning(project, "sub") def check_inconsistent_sub_or_ses_level_warning(self, project, sub_or_ses): - with pytest.warns(UserWarning) as w: project._show_pre_transfer_messages()