[libvirt] [dbus PATCH 1/4] tests: Drop pytest.mark.usefixtures from test_nodedev

Andrea Bolognani posted 4 patches 7 years, 6 months ago
[libvirt] [dbus PATCH 1/4] tests: Drop pytest.mark.usefixtures from test_nodedev
Posted by Andrea Bolognani 7 years, 6 months ago
We're already using node_device_create explicitly for all
test cases in order to retrieve the result of the fixture,
so using pytest.mark.usefixtures as well is pointless.

Additionally, we're soon going to add some test cases
where we need the fixture *not* to run automatically.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 tests/test_nodedev.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tests/test_nodedev.py b/tests/test_nodedev.py
index 22c8d60..082cf0b 100755
--- a/tests/test_nodedev.py
+++ b/tests/test_nodedev.py
@@ -5,7 +5,6 @@ import libvirttest
 import pytest
 
 
-@pytest.mark.usefixtures("node_device_create")
 class TestNodeDevice(libvirttest.BaseTestClass):
     """ Tests for methods and properties of the NodeDevice interface
     """
-- 
2.17.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [dbus PATCH 1/4] tests: Drop pytest.mark.usefixtures from test_nodedev
Posted by Ján Tomko 7 years, 5 months ago
On Fri, Jul 27, 2018 at 02:37:38PM +0200, Andrea Bolognani wrote:
>We're already using node_device_create explicitly for all
>test cases in order to retrieve the result of the fixture,
>so using pytest.mark.usefixtures as well is pointless.
>
>Additionally, we're soon going to add some test cases
>where we need the fixture *not* to run automatically.
>
>Signed-off-by: Andrea Bolognani <abologna@redhat.com>
>---
> tests/test_nodedev.py | 1 -
> 1 file changed, 1 deletion(-)
>
>diff --git a/tests/test_nodedev.py b/tests/test_nodedev.py
>index 22c8d60..082cf0b 100755
>--- a/tests/test_nodedev.py
>+++ b/tests/test_nodedev.py
>@@ -5,7 +5,6 @@ import libvirttest
> import pytest
>
>
>-@pytest.mark.usefixtures("node_device_create")
> class TestNodeDevice(libvirttest.BaseTestClass):
>     """ Tests for methods and properties of the NodeDevice interface
>     """

This patch broke syntax-check:
./tests/test_nodedev.py:5:1: F401 'pytest' imported but unused
import pytest
^

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [dbus PATCH 1/4] tests: Drop pytest.mark.usefixtures from test_nodedev
Posted by Andrea Bolognani 7 years, 5 months ago
On Mon, 2018-08-13 at 14:11 +0200, Ján Tomko wrote:
> On Fri, Jul 27, 2018 at 02:37:38PM +0200, Andrea Bolognani wrote:
> > -@pytest.mark.usefixtures("node_device_create")
> > class TestNodeDevice(libvirttest.BaseTestClass):
> >     """ Tests for methods and properties of the NodeDevice interface
> >     """
> 
> This patch broke syntax-check:
> ./tests/test_nodedev.py:5:1: F401 'pytest' imported but unused
> import pytest
> ^

I hadn't even realized we have syntax-check O:-)

https://www.redhat.com/archives/libvir-list/2018-August/msg00852.html

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list