From 9ec817e9067af65fe407a9fb33e169b2495d9589 Mon Sep 17 00:00:00 2001 From: Brett Date: Mon, 18 Sep 2023 07:43:55 -0400 Subject: [PATCH] move fsspec imports in tests to top of file --- asdf/_tests/test_asdf.py | 5 +---- asdf/_tests/test_generic_io.py | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/asdf/_tests/test_asdf.py b/asdf/_tests/test_asdf.py index bab703f04..88366642b 100644 --- a/asdf/_tests/test_asdf.py +++ b/asdf/_tests/test_asdf.py @@ -1,5 +1,6 @@ import os +import fsspec import pytest from asdf import config_context @@ -372,8 +373,6 @@ def test_fsspec(tmp_path): Issue #1146 reported errors when opening a fsspec 'file' This is a regression test for the fix in PR #1226 """ - import fsspec - tree = {"a": 1} af = AsdfFile(tree) fn = tmp_path / "test.asdf" @@ -391,8 +390,6 @@ def test_fsspec_http(httpserver): filesystem) This is a regression test for the fix in PR #1228 """ - import fsspec - tree = {"a": 1} af = AsdfFile(tree) path = os.path.join(httpserver.tmpdir, "test") diff --git a/asdf/_tests/test_generic_io.py b/asdf/_tests/test_generic_io.py index f04b853b2..1101f9f05 100644 --- a/asdf/_tests/test_generic_io.py +++ b/asdf/_tests/test_generic_io.py @@ -5,6 +5,7 @@ import sys import urllib.request as urllib_request +import fsspec import numpy as np import pytest @@ -785,8 +786,6 @@ def test_fsspec(tmp_path): Issue #1146 reported errors when opening a fsspec 'file' This is a regression test for the fix in PR #1226 """ - import fsspec - ref = b"01234567890" fn = tmp_path / "test" @@ -810,8 +809,6 @@ def test_fsspec_http(httpserver): filesystem) This is a regression test for the fix in PR #1228 """ - import fsspec - ref = b"01234567890" path = os.path.join(httpserver.tmpdir, "test")