changeset 1187:161cba5d031a

tests: pytest deprecated API
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 15 Jun 2021 22:34:51 -0700
parents 2ead9dcb6bec
children a7c43131d871
files tests/conftest.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/tests/conftest.py	Fri Oct 23 23:50:42 2020 -0700
+++ b/tests/conftest.py	Tue Jun 15 22:34:51 2021 -0700
@@ -62,11 +62,11 @@
     if path.ext == '.yaml' and path.basename.startswith("test"):
         category = os.path.basename(path.dirname)
         if category == 'bakes':
-            return BakeTestFile(path, parent)
+            return BakeTestFile.from_parent(parent, fspath=path)
         elif category == 'cli':
-            return ChefTestFile(path, parent)
+            return ChefTestFile.from_parent(parent, fspath=path)
         elif category == 'servings':
-            return ServeTestFile(path, parent)
+            return ServeTestFile.from_parent(parent, fspath=path)
 
 
 def repr_nested_failure(excinfo):
@@ -89,7 +89,7 @@
             name = '%s_%d' % (self.fspath.basename, i)
             if 'test_name' in item:
                 name += '_%s' % item['test_name']
-            yield self.__item_class__(name, self, item)
+            yield self.__item_class__.from_parent(self, name=name, spec=item)
 
 
 class YamlTestItemBase(pytest.Item):