.env - it doesn't exist. dotenv.read_dotenv(os.path.join(virtual_env_path, f'../{early_config.getini("env_path")[0]}'))

x·2023년 8월 26일
0

pytest

목록 보기
2/6

환경 : vscode, pytest, django, poetry venv, pytest-django-dotenv
poetry 가상환경에서 pytest를 실행하면 에러가 발생함

원인 : pytest-django-dotenv 이게 poetry 가상환경 경로 + pytest.ini의 env_path로 load_env를 하려고 해서 문제가 생겼음.

pytest-django-dotenv, django-dotenv를 삭제하니까 해결됨.

../../Library/Caches/pypoetry/virtualenvs/modu-property-QPeBIGhf-py3.9/lib/python3.9/site-packages/pytest_django_dotenv/plugin.py:17
  /Users/hoony/Library/Caches/pypoetry/virtualenvs/modu-property-QPeBIGhf-py3.9/lib/python3.9/site-packages/pytest_django_dotenv/plugin.py:17: UserWarning: Not reading /Users/hoony/Library/Caches/pypoetry/virtualenvs/modu-property-QPeBIGhf-py3.9/../.env - it doesn't exist.
    dotenv.read_dotenv(os.path.join(virtual_env_path, f'../{early_config.getini("env_path")[0]}'))

0개의 댓글