1
0
mirror of https://github.com/python-escpos/python-escpos synced 2025-08-24 09:03:34 +00:00

improve type annotations in tests (#613)

This commit is contained in:
Patrick Kanzler
2023-12-17 01:15:59 +01:00
committed by GitHub
parent 0c824cf295
commit b66dafc90e
6 changed files with 17 additions and 16 deletions

View File

@@ -14,14 +14,14 @@ import pytest
import escpos.escpos as escpos
def test_abstract_base_class_raises():
def test_abstract_base_class_raises() -> None:
"""test whether the abstract base class raises an exception for ESC/POS"""
with pytest.raises(TypeError):
# This call should raise TypeError because of abstractmethod _raw()
escpos.Escpos()
escpos.Escpos() # type: ignore [abstract]
def test_abstract_base_class():
def test_abstract_base_class() -> None:
"""test whether Escpos has the metaclass ABCMeta"""
assert issubclass(escpos.Escpos, object)
assert type(escpos.Escpos) is ABCMeta