## TL;DR

asyncio_mode=auto is silently ignored when it is set in a config file pytest never loads, or when another async plugin claims the tests first. Verify the setting is in the config file pytest actually reads, confirm pytest-asyncio is installed in the running environment, and check for plugin conflicts. Collection output tells you the truth.

## Error

```text
pytest asyncio_mode=auto not picking up async tests: how to fix
```

pytest --co -q lists the async tests as skipped (or omits them) even though asyncio_mode = auto is set.

## Steps

1. Confirm the plugin is installed where the tests run: pip show pytest-asyncio. Expected output: a version compatible with your pytest version.
2. Check which config file pytest loads: run pytest --co -q and read the rootdir and inifile lines at the top. Expected output: the inifile path matches the file where you set asyncio_mode.
3. Put the setting under [tool.pytest.ini_options] in pyproject.toml as a quoted string, or under [pytest] in pytest.ini or setup.cfg, exactly asyncio_mode = auto. Expected output: pytest --co -q collects the async tests instead of skipping them.
4. Look for competing plugins: anyio's pytest plugin in auto mode can claim async tests first. Expected output: only one async plugin active, or anyio explicitly scoped.
5. Run one async test verbosely to confirm it executed rather than skipped. Expected output: PASSED, not SKIPPED.

## When to use

- Async tests show as skipped with asyncio_mode=auto set.
- The setting works in one repo but not another.
- Migrating from explicit pytest.mark.asyncio to auto mode.

## When not to use

- Async fixtures error (that is fixture scope config, not collection mode).
- You use anyio or trio deliberately (configure that plugin instead).
- Tests are collected but fail (the mode is working; debug the test).

## Variant phrasings

### Async tests skipped silently

Skipped with no warning usually means the mode setting never loaded; check inifile first, not the plugin.

### event_loop fixture warnings

Newer pytest-asyncio versions changed the event loop fixture; warnings about it are separate from collection mode.

### Auto mode works locally but not in CI

CI often installs from a lockfile that pins an older pytest-asyncio, or runs with -p no:cacheprovider masking config; diff the environments.

## Why it happens

asyncio_mode is a pytest ini option, so it only takes effect from the ini file pytest selects at startup. A setting in the wrong file, an env without the plugin, or a second async plugin that registers its own collection hook will all silently leave async tests uncollected.

## Edge cases

- In pyproject.toml the value must be a quoted string; a bare word is a TOML error, not a pytest error.
- asyncio_mode=auto applies to all async tests including ones you meant to run under anyio; scope with markers if you mix.
- Strict mode plus auto mode in different config files: the last-loaded ini wins, which may not be the file you edited.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_Hg9MXsDwZVmpkIwJgf89mw
