test: Make pytest automatically recognize async tests
This commit is contained in:
parent
4996931b54
commit
a05a1aa182
@ -64,6 +64,7 @@ max-line-length = 120
|
|||||||
|
|
||||||
[tool.pytest.ini_options]
|
[tool.pytest.ini_options]
|
||||||
addopts = "--cov=. --no-cov-on-fail"
|
addopts = "--cov=. --no-cov-on-fail"
|
||||||
|
asyncio_mode = "auto"
|
||||||
ignore = "examples"
|
ignore = "examples"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
|
|
||||||
"""Tests for the box stream"""
|
"""Tests for the box stream"""
|
||||||
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
from secret_handshake.boxstream import HEADER_LENGTH, BoxStream, UnboxStream
|
from secret_handshake.boxstream import HEADER_LENGTH, BoxStream, UnboxStream
|
||||||
|
|
||||||
from .helpers import AsyncBuffer, async_comprehend
|
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"
|
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:
|
async def test_boxstream() -> None:
|
||||||
"""Test stream boxing"""
|
"""Test stream boxing"""
|
||||||
|
|
||||||
@ -63,7 +60,6 @@ async def test_boxstream() -> None:
|
|||||||
assert await buffer.read() == MESSAGE_CLOSED
|
assert await buffer.read() == MESSAGE_CLOSED
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
|
||||||
async def test_unboxstream() -> None:
|
async def test_unboxstream() -> None:
|
||||||
"""Test stream unboxing"""
|
"""Test stream unboxing"""
|
||||||
|
|
||||||
@ -76,7 +72,6 @@ async def test_unboxstream() -> None:
|
|||||||
assert unbox_stream.closed
|
assert unbox_stream.closed
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
|
||||||
async def test_long_packets() -> None:
|
async def test_long_packets() -> None:
|
||||||
"""Test for receiving long packets"""
|
"""Test for receiving long packets"""
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user