diff mbox series

test: Update test_fs to not use deprecated pytest.yield_fixture()

Message ID 20210128193956.30928-1-trini@konsulko.com
State Accepted
Commit a59e59c9be844553384b67c36a8040f65ec10011
Delegated to: Tom Rini
Headers show
Series test: Update test_fs to not use deprecated pytest.yield_fixture() | expand

Commit Message

Tom Rini Jan. 28, 2021, 7:39 p.m. UTC
As noted in comments, yield_fixture has been deprecated for longer than
our minimum required version of pytest.  Newer versions of pytest cause
this to be a louder warning, and as the migration is trivial, perform it
now.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 test/py/tests/test_fs/conftest.py | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

Comments

Tom Rini Jan. 30, 2021, 7:22 p.m. UTC | #1
On Thu, Jan 28, 2021 at 02:39:56PM -0500, Tom Rini wrote:

> As noted in comments, yield_fixture has been deprecated for longer than
> our minimum required version of pytest.  Newer versions of pytest cause
> this to be a louder warning, and as the migration is trivial, perform it
> now.
> 
> Signed-off-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/test/py/tests/test_fs/conftest.py b/test/py/tests/test_fs/conftest.py
index 58e8cd46ee2c..ec70e8c4ef3f 100644
--- a/test/py/tests/test_fs/conftest.py
+++ b/test/py/tests/test_fs/conftest.py
@@ -243,8 +243,7 @@  def umount_fs(mount_point):
 # Fixture for basic fs test
 #     derived from test/fs/fs-test.sh
 #
-# NOTE: yield_fixture was deprecated since pytest-3.0
-@pytest.yield_fixture()
+@pytest.fixture()
 def fs_obj_basic(request, u_boot_config):
     """Set up a file system to be used in basic fs test.
 
@@ -352,8 +351,7 @@  def fs_obj_basic(request, u_boot_config):
 #
 # Fixture for extended fs test
 #
-# NOTE: yield_fixture was deprecated since pytest-3.0
-@pytest.yield_fixture()
+@pytest.fixture()
 def fs_obj_ext(request, u_boot_config):
     """Set up a file system to be used in extended fs test.
 
@@ -439,8 +437,7 @@  def fs_obj_ext(request, u_boot_config):
 #
 # Fixture for mkdir test
 #
-# NOTE: yield_fixture was deprecated since pytest-3.0
-@pytest.yield_fixture()
+@pytest.fixture()
 def fs_obj_mkdir(request, u_boot_config):
     """Set up a file system to be used in mkdir test.
 
@@ -472,8 +469,7 @@  def fs_obj_mkdir(request, u_boot_config):
 #
 # Fixture for unlink test
 #
-# NOTE: yield_fixture was deprecated since pytest-3.0
-@pytest.yield_fixture()
+@pytest.fixture()
 def fs_obj_unlink(request, u_boot_config):
     """Set up a file system to be used in unlink test.
 
@@ -538,8 +534,7 @@  def fs_obj_unlink(request, u_boot_config):
 #
 # Fixture for symlink fs test
 #
-# NOTE: yield_fixture was deprecated since pytest-3.0
-@pytest.yield_fixture()
+@pytest.fixture()
 def fs_obj_symlink(request, u_boot_config):
     """Set up a file system to be used in symlink fs test.