Skip to content

Commit

Permalink
Fix flake8 and move import check
Browse files Browse the repository at this point in the history
  • Loading branch information
oruebel committed Nov 12, 2023
1 parent aa4278a commit 8f2ffc6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
14 changes: 3 additions & 11 deletions tests/unit/test_fsspec_streaming.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
import unittest


try:
import s3fs
import fsspec

HAVE_FSSPEC = True
except ImportError:
HAVE_FSSPEC = False


from hdmf_zarr import NWBZarrIO
from .utils import check_s3fs_ffspec_installed

HAVE_FSSPEC = check_s3fs_ffspec_installed()


class TestFSSpecStreaming(unittest.TestCase):
Expand Down
10 changes: 10 additions & 0 deletions tests/unit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ def get_temp_filepath():
return temp_file.name


def check_s3fs_ffspec_installed():
"""Check if s3fs and ffspec are installed required for streaming access from S3"""
try:
import s3fs # noqa F401
import fsspec # noqa F401
return True
except ImportError:
return False


############################################
# Foo example data containers and specs
###########################################
Expand Down

0 comments on commit 8f2ffc6

Please sign in to comment.