You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current head of transformers shows this issue, when importing functions from pytest, the import_path function is not found. Sample error from DeepSpeed's unit tests here.
______________ ERROR collecting tests/deepspeed/test_deepspeed.py ______________
ImportError while importing test module '/tmp/actions-runner/_work/DeepSpeed/DeepSpeed/accelerate/tests/deepspeed/test_deepspeed.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../unit-test-venv/lib/python3.8/site-packages/_pytest/python.py:538: in importtestmodule
mod = import_path(path, mode=importmode, root=config.rootpath)
../unit-test-venv/lib/python3.8/site-packages/_pytest/pathlib.py:566: in import_path
importlib.import_module(module_name)
/opt/conda/envs/ptca/lib/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1014: in _gcd_import
???
<frozen importlib._bootstrap>:991: in _find_and_load
???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:671: in _load_unlocked
???
../unit-test-venv/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
exec(co, module.__dict__)
tests/deepspeed/test_deepspeed.py:26: in <module>
from transformers.testing_utils import mockenv_context
../unit-test-venv/lib/python3.8/site-packages/transformers/testing_utils.py:129: in <module>
from _pytest.doctest import (
E ImportError: cannot import name 'import_path' from '_pytest.doctest' (/tmp/actions-runner/_work/DeepSpeed/DeepSpeed/unit-test-venv/lib/python3.8/site-packages/_pytest/doctest.py)
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 4.71s ===============================
Hi @DonggeunYu - I believe the linked PR alone should be all we need here, the latest version of pytest (>= 8.0.1) have finally deprecated including import_path from _pytest.doctest to _pytest.pathlib, so this import path needs to be updated.
System Info
Current head of transformers shows this issue, when importing functions from pytest, the
import_path
function is not found. Sample error from DeepSpeed's unit tests here.Who can help?
@pacman100
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
With pytest 8.0.1:
from _pytest.doctest import import_path
Expected behavior
No errors.
The text was updated successfully, but these errors were encountered: