From a05a1aa182d56eb1f0632ca67a822dead09b191a Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 31 Oct 2023 05:59:42 +0100 Subject: [PATCH] test: Make pytest automatically recognize async tests --- pyproject.toml | 1 + tests/test_boxstream.py | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4037afb..5e8990f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,6 +64,7 @@ max-line-length = 120 [tool.pytest.ini_options] addopts = "--cov=. --no-cov-on-fail" +asyncio_mode = "auto" ignore = "examples" [build-system] diff --git a/tests/test_boxstream.py b/tests/test_boxstream.py index a341881..dbf60f3 100644 --- a/tests/test_boxstream.py +++ b/tests/test_boxstream.py @@ -20,8 +20,6 @@ """Tests for the box stream""" -import pytest - from secret_handshake.boxstream import HEADER_LENGTH, BoxStream, UnboxStream from .helpers import AsyncBuffer, async_comprehend @@ -37,7 +35,6 @@ MESSAGE_3 = ( MESSAGE_CLOSED = b"\xb1\x14hU'\xb5M\xa6\"\x03\x9duy\xa1\xd4evW,\xdcE\x18\xe4+ C4\xe8h\x96\xed\xc5\x94\x80" -@pytest.mark.asyncio async def test_boxstream() -> None: """Test stream boxing""" @@ -63,7 +60,6 @@ async def test_boxstream() -> None: assert await buffer.read() == MESSAGE_CLOSED -@pytest.mark.asyncio async def test_unboxstream() -> None: """Test stream unboxing""" @@ -76,7 +72,6 @@ async def test_unboxstream() -> None: assert unbox_stream.closed -@pytest.mark.asyncio async def test_long_packets() -> None: """Test for receiving long packets"""