diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..943e0a6 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,27 @@ +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') + diff --git a/tests/test_cli.py b/tests/test_cli.py index 90dbf18..2f1321b 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,33 +1,8 @@ import pytest -import os -import vagrant +#import os import dotenv -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') - def test_no_arguments(script_runner, script): result = script_runner.run(script) assert result.success is False