Commit 9950c0c4 authored by Pavel Hrdina's avatar Pavel Hrdina

tests: fix test_connect_node_device_create_xml test case

Calling fixtures directly was removed in pytest 4.0, we can change the
fixture to be a wrapper around the original function and use the
original fixture name.
Signed-off-by: Pavel Hrdina's avatarPavel Hrdina <phrdina@redhat.com>
Reviewed-by: 's avatarJán Tomko <jtomko@redhat.com>
parent 21f70c80
...@@ -84,13 +84,7 @@ class BaseTestClass(): ...@@ -84,13 +84,7 @@ class BaseTestClass():
interface_obj.Create(0) interface_obj.Create(0)
return path, interface_obj return path, interface_obj
@pytest.fixture
def node_device_create(self): def node_device_create(self):
""" Fixture to create dummy node device on the test driver
This fixture should be used in the setup of every test manipulating
with node devices.
"""
# We need a usable parent nodedev: possible candidates are # We need a usable parent nodedev: possible candidates are
# scsi_host2 (available since libvirt 3.1.0) and # scsi_host2 (available since libvirt 3.1.0) and
# test-scsi-host-vport (available until libvirt 3.0.0). # test-scsi-host-vport (available until libvirt 3.0.0).
...@@ -109,6 +103,15 @@ class BaseTestClass(): ...@@ -109,6 +103,15 @@ class BaseTestClass():
path = self.connect.NodeDeviceCreateXML(xml, 0) path = self.connect.NodeDeviceCreateXML(xml, 0)
return path return path
@pytest.fixture(name="node_device_create")
def fixture_node_device_create(self):
""" Fixture to create dummy node device on the test driver
This fixture should be used in the setup of every test manipulating
with node devices.
"""
return self.node_device_create()
@pytest.fixture @pytest.fixture
def storage_volume_create(self): def storage_volume_create(self):
""" Fixture to create dummy storage volume on the test driver """ Fixture to create dummy storage volume on the test driver
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment