File tree Expand file tree Collapse file tree
src/tests/action_model_testing/vjepa/clips_without_coi_crop Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77
88from __future__ import annotations
99
10+ import importlib .machinery
1011import os
1112import sys
1213import types
1617# The module hard-imports `decord` at module load time. decord ships only as
1718# manylinux wheels, so stub it out here for platforms/CI runners where it
1819# isn't installed; the tests below never touch VideoReader/cpu directly.
20+ # A bare types.ModuleType leaves __spec__ as None, which later crashes
21+ # importlib.util.find_spec("decord") (e.g. transformers' optional-dep probing)
22+ # for any other test collected in this same pytest process, so give it a spec.
1923if "decord" not in sys .modules :
2024 _decord_stub = types .ModuleType ("decord" )
2125 _decord_stub .VideoReader = object
2226 _decord_stub .cpu = lambda * args , ** kwargs : None
27+ _decord_stub .__spec__ = importlib .machinery .ModuleSpec ("decord" , loader = None )
2328 sys .modules ["decord" ] = _decord_stub
2429
2530# The module also calls os.makedirs(OUTPUT_BASE, ...) at import time against
Original file line number Diff line number Diff line change 77
88from __future__ import annotations
99
10+ import importlib .machinery
1011import os
1112import sys
1213import types
1718# The module hard-imports `decord` at module load time. decord ships only as
1819# manylinux wheels, so stub it out here for platforms/CI runners where it
1920# isn't installed; the tests below never touch VideoReader/cpu directly.
21+ # A bare types.ModuleType leaves __spec__ as None, which later crashes
22+ # importlib.util.find_spec("decord") (e.g. transformers' optional-dep probing)
23+ # for any other test collected in this same pytest process, so give it a spec.
2024if "decord" not in sys .modules :
2125 _decord_stub = types .ModuleType ("decord" )
2226 _decord_stub .VideoReader = object
2327 _decord_stub .cpu = lambda * args , ** kwargs : None
28+ _decord_stub .__spec__ = importlib .machinery .ModuleSpec ("decord" , loader = None )
2429 sys .modules ["decord" ] = _decord_stub
2530
2631# The module also calls os.makedirs(OUTPUT_BASE, ...) at import time against
You can’t perform that action at this time.
0 commit comments