Skip to content

Commit 4aa3109

Browse files
committed
Guard the object store test helper module for isolated package testing
pytest collects _unification_utils.py directly, so its module-level galaxy.files imports must also be guarded with importorskip (not just the test modules that use them). Fixes the remaining "Test Galaxy packages" collection error.
1 parent 1afed38 commit 4aa3109

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

test/unit/objectstore/_unification_utils.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,18 @@
66
import os
77
from uuid import uuid4
88

9-
from galaxy.files.plugins import FileSourcePluginsConfig
10-
from galaxy.files.unittest_utils import TestConfiguredFileSources
9+
import pytest
10+
1111
from galaxy.util import directory_hash_id
1212

13+
# These helpers need galaxy-files + fsspec; skip cleanly when the galaxy-objectstore package
14+
# is tested in isolation without them (this module is collected directly by pytest).
15+
pytest.importorskip("fsspec")
16+
pytest.importorskip("galaxy.files")
17+
18+
from galaxy.files.plugins import FileSourcePluginsConfig # noqa: E402 (after importorskip)
19+
from galaxy.files.unittest_utils import TestConfiguredFileSources # noqa: E402 (after importorskip)
20+
1321

1422
class Dataset:
1523
def __init__(self, id):

0 commit comments

Comments
 (0)