Skip to content

[adoption] managed pytest config has no pass-through for pytest-asyncio ini settings, breaking subproject async tests #206

Description

@chrisdpurcell

Outcome

The managed pytest configuration exposes no closed option for pytest-asyncio settings (notably asyncio_mode), and the managed [tool.pytest.ini_options] at the root shadows a subproject's own pyproject configuration. A repository adopting python-tooling over a subproject with async tests fails its gate until tests are edited or an undocumented mechanism is found.

Evidence

  • Fresh adoption, project-standards 5.26.0 (v5.26.0), Linux, Python 3.14.7.
  • python-tooling 1.16 with pytest.test_paths = ["subproj/tests"]; the subproject's own pyproject.toml sets asyncio_mode = "auto" under its own [tool.pytest.ini_options].
  • Under the root-managed config, pytest's rootdir is the repository root, so the subproject ini is not read; async tests fail with:
Failed: async def functions are not natively supported

The closed pytest options (fail_under, markers, coverage_exclude_also, test_paths) cannot express asyncio_mode, and [tool.pytest.ini_options] cannot be declared twice.

Expected behavior

Either a closed option to pass through pytest ini values (e.g. ini = { asyncio_mode = "auto" }), or adoption guidance stating that async tests must carry explicit pytest.mark.asyncio markers when adopted under a root-managed configuration, plus that the async plugin must be added via additional_dev_dependencies.

Workaround used

Added module-level pytestmark = pytest.mark.asyncio to the affected test modules (compatible with both asyncio modes) and pytest-asyncio through additional_dev_dependencies.

Blocks progress: no (workaround found).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions