Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit f14daa4

Browse files
authored
Removes pytest-lazy-fixture dependency to allow pytest to be unpinned (#388)
1 parent 3481235 commit f14daa4

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

requirements-dev.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ moto >= 3.1.16, < 4.2.5
1515
mypy
1616
pillow
1717
pre-commit
18-
pytest > 7, < 8
18+
pytest
1919
pytest-asyncio >= 0.18.2, != 0.22.0, < 0.23.0 # Cannot override event loop in 0.23.0. See https://github.com/pytest-dev/pytest-asyncio/issues/706 for more details.
2020
pytest-cov
21-
pytest-lazy-fixture
2221
pytest-xdist
2322
types-boto3 >= 1.0.2

tests/test_lambda_function.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import pytest
99
from botocore.response import StreamingBody
1010
from moto import mock_iam, mock_lambda
11-
from pytest_lazyfixture import lazy_fixture
1211

1312
from prefect_aws.credentials import AwsCredentials
1413
from prefect_aws.lambda_function import LambdaFunction
@@ -232,8 +231,8 @@ def test_invoke_lambda_client_context(
232231
@pytest.mark.parametrize(
233232
"func_fixture,expected,handler",
234233
[
235-
(lazy_fixture("mock_lambda_function"), {"foo": "bar"}, handler_a),
236-
(lazy_fixture("add_lambda_version"), {"data": [1, 2, 3]}, handler_b),
234+
("mock_lambda_function", {"foo": "bar"}, handler_a),
235+
("add_lambda_version", {"data": [1, 2, 3]}, handler_b),
237236
],
238237
)
239238
def test_invoke_lambda_qualifier(
@@ -242,7 +241,9 @@ def test_invoke_lambda_qualifier(
242241
expected,
243242
lambda_function: LambdaFunction,
244243
mock_invoke,
244+
request,
245245
):
246+
func_fixture = request.getfixturevalue(func_fixture)
246247
try:
247248
lambda_function.qualifier = func_fixture["Version"]
248249
result = lambda_function.invoke()

tests/test_s3.py

+11-12
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from moto import mock_s3
99
from prefect import flow
1010
from prefect.deployments import Deployment
11-
from pytest_lazyfixture import lazy_fixture
1211

1312
from prefect_aws import AwsCredentials, MinIOCredentials
1413
from prefect_aws.client_parameters import AwsClientParameters
@@ -22,9 +21,9 @@
2221
)
2322

2423
aws_clients = [
25-
(lazy_fixture("aws_client_parameters_custom_endpoint")),
26-
(lazy_fixture("aws_client_parameters_empty")),
27-
(lazy_fixture("aws_client_parameters_public_bucket")),
24+
"aws_client_parameters_custom_endpoint",
25+
"aws_client_parameters_empty",
26+
"aws_client_parameters_public_bucket",
2827
]
2928

3029

@@ -38,7 +37,7 @@ def s3_mock(monkeypatch, client_parameters):
3837

3938
@pytest.fixture
4039
def client_parameters(request):
41-
client_parameters = request.param
40+
client_parameters = request.getfixturevalue(request.param)
4241
return client_parameters
4342

4443

@@ -114,7 +113,7 @@ def a_lot_of_objects(bucket, tmp_path):
114113

115114
@pytest.mark.parametrize(
116115
"client_parameters",
117-
[lazy_fixture("aws_client_parameters_custom_endpoint")],
116+
["aws_client_parameters_custom_endpoint"],
118117
indirect=True,
119118
)
120119
async def test_s3_download_failed_with_wrong_endpoint_setup(
@@ -141,30 +140,30 @@ async def test_flow():
141140
"client_parameters",
142141
[
143142
pytest.param(
144-
lazy_fixture("aws_client_parameters_custom_endpoint"),
143+
"aws_client_parameters_custom_endpoint",
145144
marks=pytest.mark.is_public(False),
146145
),
147146
pytest.param(
148-
lazy_fixture("aws_client_parameters_custom_endpoint"),
147+
"aws_client_parameters_custom_endpoint",
149148
marks=pytest.mark.is_public(True),
150149
),
151150
pytest.param(
152-
lazy_fixture("aws_client_parameters_empty"),
151+
"aws_client_parameters_empty",
153152
marks=pytest.mark.is_public(False),
154153
),
155154
pytest.param(
156-
lazy_fixture("aws_client_parameters_empty"),
155+
"aws_client_parameters_empty",
157156
marks=pytest.mark.is_public(True),
158157
),
159158
pytest.param(
160-
lazy_fixture("aws_client_parameters_public_bucket"),
159+
"aws_client_parameters_public_bucket",
161160
marks=[
162161
pytest.mark.is_public(False),
163162
pytest.mark.xfail(reason="Bucket is not a public one"),
164163
],
165164
),
166165
pytest.param(
167-
lazy_fixture("aws_client_parameters_public_bucket"),
166+
"aws_client_parameters_public_bucket",
168167
marks=pytest.mark.is_public(True),
169168
),
170169
],

0 commit comments

Comments
 (0)