litestar-org/polyfactory

Bug: Package dependy on `pytest`

Closed this issue · 0 comments

Description

When installing polyfactory and importing it via import polyfactory you get a ModuleNotFoundError for pytest.

URL to code causing the issue

No response

MCVE

import polyfactory

Steps to reproduce

1. Don't have pytest installed
2. `pip install polyfactory`
3. `python -c "import polyfactory"

Screenshots

"![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"

Logs

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/john/.cache/pypoetry/virtualenvs/litestar-2yNBwiFi-py3.11/lib/python3.11/site-packages/polyfactory/__init__.py", line 2, in <module>
    from .factories import BaseFactory, DataclassFactory, TypedDictFactory
  File "/home/john/.cache/pypoetry/virtualenvs/litestar-2yNBwiFi-py3.11/lib/python3.11/site-packages/polyfactory/factories/__init__.py", line 1, in <module>
    from polyfactory.factories.base import BaseFactory, DataclassFactory, TypedDictFactory
  File "/home/john/.cache/pypoetry/virtualenvs/litestar-2yNBwiFi-py3.11/lib/python3.11/site-packages/polyfactory/factories/base.py", line 51, in <module>
    from polyfactory.fields import Fixture, Ignore, PostGenerated, Require, Use
  File "/home/john/.cache/pypoetry/virtualenvs/litestar-2yNBwiFi-py3.11/lib/python3.11/site-packages/polyfactory/fields.py", line 6, in <module>
    from polyfactory.pytest_plugin import FactoryFixture
  File "/home/john/.cache/pypoetry/virtualenvs/litestar-2yNBwiFi-py3.11/lib/python3.11/site-packages/polyfactory/pytest_plugin.py", line 14, in <module>
    from pytest import fixture
ModuleNotFoundError: No module named 'pytest'

Starlite Version

Platform

  • Linux
  • Mac
  • Windows
  • Other (Please specify in the description above)