# HG changeset patch # User David Douard # Date 1528042187 -7200 # Node ID bb477c9ea28da56b637d682bc0fde8fbed07052e # Parent 89123c2af2fd545aea674d76956f0ea9dd959fea [test] add a conftest.py file with fixtures for prologix emulator setup in tests diff -r 89123c2af2fd -r bb477c9ea28d pygpibtoolkit/test/conftest.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pygpibtoolkit/test/conftest.py Sun Jun 03 18:09:47 2018 +0200 @@ -0,0 +1,20 @@ +import serial +import pygpibtoolkit.prologix_emulator as PE + +import pytest + + +@pytest.fixture(scope='session') +def newemulator(): + emul = PE.PrologixEmulator() + cnx = serial.Serial(emul.serialurl, timeout=0) + yield (emul, cnx) + emul.close() + cnx.close() + + +@pytest.fixture +def emulator(newemulator): + emul, cnx = newemulator + emul.reset() + return emul, cnx