scullery/tests/conftest.py
Georg Pfuetzenreuter 1788a9cdf3
Move fixtures to conftest
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2023-05-21 06:03:49 +02:00

28 lines
497 B
Python

import pytest
import os
import libvirt
@pytest.fixture
def script():
is_packaged = False
script = 'scullery'
if not is_packaged:
script = f'{script}.py'
return script
@pytest.fixture
def testbase():
return os.path.abspath(os.path.dirname(os.getenv('PYTEST_CURRENT_TEST')))
@pytest.fixture
def config(testbase, request):
return '{}/configs/{}.ini'.format(testbase, request.param)
@pytest.fixture
def virt():
return libvirt.openReadOnly('qemu:///system')