Skip to content

Commit 5088136

Browse files
committed
tests(async) Basic example
1 parent 1103e6a commit 5088136

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/test_async.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""Tests for libtmux with :mod`asyncio` support."""
2+
3+
import logging
4+
5+
import pytest
6+
7+
from libtmux.server import Server
8+
from libtmux.session import Session
9+
10+
logger = logging.getLogger(__name__)
11+
12+
13+
@pytest.mark.asyncio
14+
async def test_asyncio(server: "Server") -> None:
15+
"""Test basic asyncio usage."""
16+
result = await server.acmd("new-session", "-d", "-P", "-F#{session_id}")
17+
session_id = result.stdout[0]
18+
session = Session.from_session_id(
19+
session_id=session_id,
20+
server=server,
21+
)
22+
assert isinstance(session, Session)

0 commit comments

Comments
 (0)