Skip to content

pyproject.toml seems to be ignored #933

@mraesener-aubex

Description

@mraesener-aubex

Hey everybody,

I try to setup pytest-asyncio in a django project and it seems pytest-asyncio doesn't detect the settings in my pyproject.toml

in the project root toml I set the following:

[tool.pytest.ini_otions]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"

and then I get the following output from pytest (paths for rootdir and venv shortened)

pytest -v                 
./.venv/lib/python3.12/site-packages/pytest_asyncio/plugin.py:208: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the fixture caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to function scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
===================================================================================== test session starts ======================================================================================
platform darwin -- Python 3.12.4, pytest-8.3.2, pluggy-1.5.0 -- ./.venv/bin/python3
cachedir: .pytest_cache
rootdir: .
configfile: pyproject.toml
plugins: asyncio-0.24.0, django-4.9.0
asyncio: mode=Mode.STRICT, default_loop_scope=None
collected 0 items

is there anything obvious I'm doing wrong?

if this might be an actual issue, how could I make sure it actually is?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions