File: conftest.py

package info (click to toggle)
pymodbus 3.8.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,720 kB
  • sloc: python: 14,867; makefile: 27; sh: 17
file content (23 lines) | stat: -rw-r--r-- 568 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""Configure pytest."""
from __future__ import annotations

import pytest

from pymodbus.framer import FRAMER_NAME_TO_CLASS, FramerType
from pymodbus.pdu import DecodePDU


@pytest.fixture(name="entry")
def prepare_entry():
    """Return framer_type."""
    return FramerType.RTU

@pytest.fixture(name="is_server")
def prepare_is_server():
    """Return client/server."""
    return False

@pytest.fixture(name="test_framer")
async def prepare_test_framer(entry, is_server):
    """Return framer object."""
    return FRAMER_NAME_TO_CLASS[entry](DecodePDU(is_server))