mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
25 lines
659 B
Python
25 lines
659 B
Python
import pytest
|
|
|
|
from textual.devtools import _make_devtools_aiohttp_app
|
|
from textual.devtools_client import DevtoolsClient
|
|
|
|
|
|
@pytest.fixture
|
|
async def server(aiohttp_server, unused_tcp_port):
|
|
app = _make_devtools_aiohttp_app(
|
|
size_change_poll_delay_secs=0.001,
|
|
)
|
|
server = await aiohttp_server(app, port=unused_tcp_port)
|
|
yield server
|
|
await server.close()
|
|
|
|
|
|
@pytest.fixture
|
|
async def devtools(aiohttp_client, server):
|
|
client = await aiohttp_client(server)
|
|
devtools = DevtoolsClient(address=client.host, port=client.port)
|
|
await devtools.connect()
|
|
yield devtools
|
|
await devtools.disconnect()
|
|
await client.close()
|