# RuntimeError: no running event loop
  File ".../pytest_asyncio/plugin.py", line ..., in pytest_pyfunc_call
    result = loop.run_until_complete(...)

- **ID:** `python/pytest-asyncio-no-running-loop`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

An async test was collected without being marked with @pytest.mark.asyncio, or pytest-asyncio mode is set to 'strict' (default) and the marker is missing. The plugin refuses to run the coroutine.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   import pytest

@pytest.mark.asyncio
async def test_fetch():
    result = await fetch()
    assert result == 42
   ```
2. **** (92% success)
   ```
   # pyproject.toml
[tool.pytest.ini_options]
asyncio_mode = "auto"

# or pytest.ini
# [pytest]
# asyncio_mode = auto
   ```

## Dead Ends

- **** — pytest-asyncio already manages the loop; calling asyncio.run() inside a coroutine raises 'asyncio.run() cannot be called from a running event loop'. (80% fail)
- **** — If pytest reads pyproject.toml instead, the config is ignored and strict mode persists. (60% fail)
