Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 363 Bytes

PT024.md

File metadata and controls

30 lines (20 loc) · 363 Bytes

PT024

pytest.mark.asyncio is unnecessary for fixtures

Examples

Bad code:

import pytest

@pytest.mark.asyncio()
@pytest.fixture()
async def my_fixture():
    return 0

Good code:

import pytest

@pytest.fixture()
async def my_fixture():
    return 0

Rationale

  • the mark is useless on fixtures and therefore unnecessary