Description: Replace no-longer-maintained pytest-lazy-fixture
Author: Alexandre Detiste <tchet@debian.org> and Julian Gilbey <jdg@debian.org>
Forwarded: https://github.com/marshmallow-code/marshmallow-sqlalchemy/pull/608
Last-Update: 2024-08-09

--- a/tests/test_sqlalchemy_schema.py
+++ b/tests/test_sqlalchemy_schema.py
@@ -2,6 +2,7 @@
 import pytest
+from pytest_lazy_fixtures import lf
 import sqlalchemy as sa
 from marshmallow import Schema, ValidationError, validate
 
 from marshmallow_sqlalchemy import SQLAlchemyAutoSchema, SQLAlchemySchema, auto_field
 from marshmallow_sqlalchemy.exceptions import IncorrectSchemaTypeError
@@ -125,8 +126,8 @@
 @pytest.mark.parametrize(
     "schema",
     (
-        pytest.lazy_fixture("sqla_schema_with_relationships"),
-        pytest.lazy_fixture("sqla_auto_model_schema_with_relationships"),
+        lf("sqla_schema_with_relationships"),
+        lf("sqla_auto_model_schema_with_relationships"),
     ),
 )
 def test_dump_with_relationships(teacher, schema):
@@ -141,8 +142,8 @@
 @pytest.mark.parametrize(
     "schema",
     (
-        pytest.lazy_fixture("sqla_schema_with_fks"),
-        pytest.lazy_fixture("sqla_auto_model_schema_with_fks"),
+        lf("sqla_schema_with_fks"),
+        lf("sqla_auto_model_schema_with_fks"),
     ),
 )
 def test_dump_with_foreign_keys(teacher, schema):
@@ -163,10 +164,10 @@
 @pytest.mark.parametrize(
     "schema",
     (
-        pytest.lazy_fixture("sqla_schema_with_relationships"),
-        pytest.lazy_fixture("sqla_schema_with_fks"),
-        pytest.lazy_fixture("sqla_auto_model_schema"),
-        pytest.lazy_fixture("sqla_auto_table_schema"),
+        lf("sqla_schema_with_relationships"),
+        lf("sqla_schema_with_fks"),
+        lf("sqla_auto_model_schema"),
+        lf("sqla_auto_table_schema"),
     ),
 )
 def test_load(schema):
@@ -217,10 +218,10 @@
     @pytest.mark.parametrize(
         "Schema",
         (
-            pytest.lazy_fixture("schema_no_load_instance"),
-            pytest.lazy_fixture("schema_with_load_instance"),
-            pytest.lazy_fixture("auto_schema_no_load_instance"),
-            pytest.lazy_fixture("auto_schema_with_load_instance"),
+            lf("schema_no_load_instance"),
+            lf("schema_with_load_instance"),
+            lf("auto_schema_no_load_instance"),
+            lf("auto_schema_with_load_instance"),
         ),
     )
     def test_toggle_load_instance_per_schema(self, models, Schema):
@@ -246,10 +247,10 @@
 @pytest.mark.parametrize(
     "schema",
     (
-        pytest.lazy_fixture("sqla_schema_with_relationships"),
-        pytest.lazy_fixture("sqla_schema_with_fks"),
-        pytest.lazy_fixture("sqla_auto_model_schema"),
-        pytest.lazy_fixture("sqla_auto_table_schema"),
+        lf("sqla_schema_with_relationships"),
+        lf("sqla_schema_with_fks"),
+        lf("sqla_auto_model_schema"),
+        lf("sqla_auto_table_schema"),
     ),
 )
 def test_load_validation_errors(schema):
@@ -373,8 +374,8 @@
     @pytest.mark.parametrize(
         "schema",
         (
-            pytest.lazy_fixture("aliased_schema"),
-            pytest.lazy_fixture("aliased_auto_schema"),
+            lf("aliased_schema"),
+            lf("aliased_auto_schema"),
         ),
     )
     def test_passing_column_name(self, schema, teacher):
@@ -417,8 +418,8 @@
     @pytest.mark.parametrize(
         "SchemaClass",
         (
-            pytest.lazy_fixture("sqla_schema_class"),
-            pytest.lazy_fixture("sqla_auto_schema_class"),
+            lf("sqla_schema_class"),
+            lf("sqla_auto_schema_class"),
         ),
     )
     def test_load(self, teacher, SchemaClass, models):
