
Python 2.7 EOL is arriving on 2020-01-01: https://pythonclock.org/ This will allow us to use Python 3 only libraries, like python-barcode, which can maintain a reduced, simpler codebase, due to only one version to support. Closes #371. Signed-off-by: Romain Porte <microjoe@microjoe.org>
21 lines
634 B
Python
21 lines
634 B
Python
#!/usr/bin/python
|
|
"""test the facility which enables usage of the with-statement
|
|
|
|
:author: `Patrick Kanzler <patrick.kanzler@fablab.fau.de>`_
|
|
:organization: `python-escpos <https://github.com/python-escpos>`_
|
|
:copyright: Copyright (c) 2016 `python-escpos <https://github.com/python-escpos>`_
|
|
:license: MIT
|
|
"""
|
|
|
|
|
|
import escpos.printer as printer
|
|
import escpos.escpos as escpos
|
|
|
|
|
|
def test_with_statement():
|
|
"""Use with statement"""
|
|
dummy_printer = printer.Dummy()
|
|
with escpos.EscposIO(dummy_printer) as p:
|
|
p.writelines('Some text.\n')
|
|
# TODO extend these tests as they don't really do anything at the moment
|