Skip to content

Commit 72e3be6

Browse files
committed
tests(async) Basic example
1 parent 3b504b0 commit 72e3be6

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Diff for: tests/test_async.py

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

0 commit comments

Comments
 (0)