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

Separate method open() and constructor, enhance consistency between connectors: Rework printer tests (#587)

* Add fixtures
* Add test_printer_file.py
* Remove old broken printer tests
* Include a close_on_reopen test
* Add test_printer_network.py
* Add test_printer_serial.py
* Add test_printer_usb.py
* Add test_printer_lp.py
* Add test_printer_cups.py
* Add test_printer_win32raw.py
* Test the 'printers' property
* Fix conftest import formatting
* Fix failing LP tests
* Cancel close only if literal False|None _device
* Fix win32raw failing tests (maybe)
* Include win32raw close_on_reopen test
* Include test _raw methods to win32raw
* Replace general exceptions in win32raw
* Replace wrong exception in cups
* Include more tests to cups
* Extend cups tests
This commit is contained in:
Benito López
2023-10-28 20:52:59 +02:00
committed by GitHub
parent e7dd97554c
commit a50a3b7167
12 changed files with 1018 additions and 103 deletions

View File

@@ -1,8 +1,49 @@
import pytest
from escpos.printer import Dummy
from escpos.exceptions import DeviceNotFoundError
from escpos.printer import LP, CupsPrinter, Dummy, File, Network, Serial, Usb, Win32Raw
@pytest.fixture
def driver():
return Dummy()
@pytest.fixture
def usbprinter():
return Usb()
@pytest.fixture
def serialprinter():
return Serial()
@pytest.fixture
def networkprinter():
return Network()
@pytest.fixture
def fileprinter():
return File()
@pytest.fixture
def lpprinter():
return LP()
@pytest.fixture
def win32rawprinter():
return Win32Raw()
@pytest.fixture
def cupsprinter():
return CupsPrinter()
@pytest.fixture
def devicenotfounderror():
return DeviceNotFoundError