File: conftest.py

package info (click to toggle)
python-p1monitor 3.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 512 kB
  • sloc: python: 571; makefile: 8; sh: 5
file content (18 lines) | stat: -rw-r--r-- 476 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""Fixture for the P1Monitor tests."""

from collections.abc import AsyncGenerator

import pytest
from aiohttp import ClientSession

from p1monitor import P1Monitor


@pytest.fixture(name="p1monitor_client")
async def client() -> AsyncGenerator[P1Monitor, None]:
    """Return a P1Monitor client."""
    async with (
        ClientSession() as session,
        P1Monitor(host="192.168.1.2", port=80, session=session) as p1monitor_client,
    ):
        yield p1monitor_client