From ab30ef4a8c98a9e1c5cfaf264fc437bcc82d1859 Mon Sep 17 00:00:00 2001 From: Romain Porte Date: Sun, 10 May 2020 14:05:33 +0200 Subject: [PATCH] test_function_softbarcode: use pytest fixture --- test/test_function_softbarcode.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/test_function_softbarcode.py b/test/test_function_softbarcode.py index 1bef1cd..f9288f7 100644 --- a/test/test_function_softbarcode.py +++ b/test/test_function_softbarcode.py @@ -4,9 +4,11 @@ import escpos.printer as printer import pytest -def test_soft_barcode(): - """just execute soft_barcode - """ - instance = printer.Dummy() +@pytest.fixture +def instance(): + return printer.Dummy() + + +def test_soft_barcode_ean8(instance): instance.soft_barcode("ean8", "1234")