File: test_interface.py

package info (click to toggle)
python-pyout 0.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 328 kB
  • sloc: python: 3,453; makefile: 3
file content (31 lines) | stat: -rw-r--r-- 1,014 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
24
25
26
27
28
29
30
31
import pytest

# Eventually we may want to retire blessings:
# https://github.com/pyout/pyout/issues/136
try:
    pytest.importorskip("blessed")
except pytest.skip.Exception:
    pytest.importorskip("blessings")

import inspect

from pyout.interface import Stream
from pyout.interface import Writer
from pyout.tabular import Tabular
from pyout.tabular import TerminalStream
from pyout.tabular_dummy import NoUpdateTerminalStream
from pyout.tabular_dummy import Tabular as DummyTabular


@pytest.mark.parametrize("writer",
                         [Tabular, DummyTabular],
                         ids=["tabular", "dummy"])
def test_writer_children_match_signature(writer):
    assert inspect.signature(writer) == inspect.signature(Writer)


@pytest.mark.parametrize("stream",
                         [TerminalStream, NoUpdateTerminalStream],
                         ids=["terminal", "noupdate"])
def test_stream_children_match_signature(stream):
    assert inspect.signature(stream) == inspect.signature(Stream)