Skip to content

Pytest 8 upgrade #791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ falcon = ">=3.0"
flask = "*"
isort = "^5.11.5"
pre-commit = "*"
pytest = "^7"
pytest = "^8"
pytest-flake8 = "*"
pytest-cov = "*"
python-multipart = "*"
Expand Down
204 changes: 130 additions & 74 deletions tests/integration/test_petstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,15 @@ def test_get_pets(self, spec):
with pytest.warns(
DeprecationWarning, match="limit parameter is deprecated"
):
result = unmarshal_request(
request,
spec=spec,
cls=V30RequestParametersUnmarshaller,
)
with pytest.warns(
DeprecationWarning,
match="Use of allowEmptyValue property is deprecated",
):
result = unmarshal_request(
request,
spec=spec,
cls=V30RequestParametersUnmarshaller,
)

assert result.parameters == Parameters(
query={
Expand Down Expand Up @@ -159,11 +163,15 @@ def test_get_pets_response(self, spec):
with pytest.warns(
DeprecationWarning, match="limit parameter is deprecated"
):
result = unmarshal_request(
request,
spec=spec,
cls=V30RequestParametersUnmarshaller,
)
with pytest.warns(
DeprecationWarning,
match="Use of allowEmptyValue property is deprecated",
):
result = unmarshal_request(
request,
spec=spec,
cls=V30RequestParametersUnmarshaller,
)

assert result.parameters == Parameters(
query={
Expand Down Expand Up @@ -219,11 +227,15 @@ def test_get_pets_response_media_type(self, spec):
with pytest.warns(
DeprecationWarning, match="limit parameter is deprecated"
):
result = unmarshal_request(
request,
spec=spec,
cls=V30RequestParametersUnmarshaller,
)
with pytest.warns(
DeprecationWarning,
match="Use of allowEmptyValue property is deprecated",
):
result = unmarshal_request(
request,
spec=spec,
cls=V30RequestParametersUnmarshaller,
)

assert result.parameters == Parameters(
query={
Expand Down Expand Up @@ -267,11 +279,15 @@ def test_get_pets_invalid_response(self, spec, response_unmarshaller):
with pytest.warns(
DeprecationWarning, match="limit parameter is deprecated"
):
result = unmarshal_request(
request,
spec=spec,
cls=V30RequestParametersUnmarshaller,
)
with pytest.warns(
DeprecationWarning,
match="Use of allowEmptyValue property is deprecated",
):
result = unmarshal_request(
request,
spec=spec,
cls=V30RequestParametersUnmarshaller,
)

assert result.parameters == Parameters(
query={
Expand Down Expand Up @@ -339,11 +355,15 @@ def test_get_pets_ids_param(self, spec):
with pytest.warns(
DeprecationWarning, match="limit parameter is deprecated"
):
result = unmarshal_request(
request,
spec=spec,
cls=V30RequestParametersUnmarshaller,
)
with pytest.warns(
DeprecationWarning,
match="Use of allowEmptyValue property is deprecated",
):
result = unmarshal_request(
request,
spec=spec,
cls=V30RequestParametersUnmarshaller,
)

assert result.parameters == Parameters(
query={
Expand Down Expand Up @@ -391,11 +411,15 @@ def test_get_pets_tags_param(self, spec):
with pytest.warns(
DeprecationWarning, match="limit parameter is deprecated"
):
result = unmarshal_request(
request,
spec=spec,
cls=V30RequestParametersUnmarshaller,
)
with pytest.warns(
DeprecationWarning,
match="Use of allowEmptyValue property is deprecated",
):
result = unmarshal_request(
request,
spec=spec,
cls=V30RequestParametersUnmarshaller,
)

assert result.parameters == Parameters(
query={
Expand Down Expand Up @@ -443,12 +467,16 @@ def test_get_pets_parameter_schema_error(self, spec):
with pytest.warns(
DeprecationWarning, match="limit parameter is deprecated"
):
with pytest.raises(ParameterValidationError) as exc_info:
validate_request(
request,
spec=spec,
cls=V30RequestParametersUnmarshaller,
)
with pytest.warns(
DeprecationWarning,
match="Use of allowEmptyValue property is deprecated",
):
with pytest.raises(ParameterValidationError) as exc_info:
validate_request(
request,
spec=spec,
cls=V30RequestParametersUnmarshaller,
)
assert type(exc_info.value.__cause__) is InvalidSchemaValue

result = unmarshal_request(
Expand All @@ -475,12 +503,16 @@ def test_get_pets_wrong_parameter_type(self, spec):
with pytest.warns(
DeprecationWarning, match="limit parameter is deprecated"
):
with pytest.raises(ParameterValidationError) as exc_info:
validate_request(
request,
spec=spec,
cls=V30RequestParametersValidator,
)
with pytest.warns(
DeprecationWarning,
match="Use of allowEmptyValue property is deprecated",
):
with pytest.raises(ParameterValidationError) as exc_info:
validate_request(
request,
spec=spec,
cls=V30RequestParametersValidator,
)
assert type(exc_info.value.__cause__) is CastError

result = unmarshal_request(
Expand All @@ -502,12 +534,16 @@ def test_get_pets_raises_missing_required_param(self, spec):
with pytest.warns(
DeprecationWarning, match="limit parameter is deprecated"
):
with pytest.raises(MissingRequiredParameter):
validate_request(
request,
spec=spec,
cls=V30RequestParametersValidator,
)
with pytest.warns(
DeprecationWarning,
match="Use of allowEmptyValue property is deprecated",
):
with pytest.raises(MissingRequiredParameter):
validate_request(
request,
spec=spec,
cls=V30RequestParametersValidator,
)

result = unmarshal_request(
request, spec=spec, cls=V30RequestBodyUnmarshaller
Expand All @@ -534,12 +570,16 @@ def test_get_pets_empty_value(self, spec):
with pytest.warns(
DeprecationWarning, match="limit parameter is deprecated"
):
with pytest.raises(ParameterValidationError) as exc_info:
validate_request(
request,
spec=spec,
cls=V30RequestParametersValidator,
)
with pytest.warns(
DeprecationWarning,
match="Use of allowEmptyValue property is deprecated",
):
with pytest.raises(ParameterValidationError) as exc_info:
validate_request(
request,
spec=spec,
cls=V30RequestParametersValidator,
)
assert type(exc_info.value.__cause__) is EmptyQueryParameterValue

result = unmarshal_request(
Expand Down Expand Up @@ -567,11 +607,15 @@ def test_get_pets_allow_empty_value(self, spec):
with pytest.warns(
DeprecationWarning, match="limit parameter is deprecated"
):
result = unmarshal_request(
request,
spec=spec,
cls=V30RequestParametersUnmarshaller,
)
with pytest.warns(
DeprecationWarning,
match="Use of allowEmptyValue property is deprecated",
):
result = unmarshal_request(
request,
spec=spec,
cls=V30RequestParametersUnmarshaller,
)

assert result.parameters == Parameters(
query={
Expand Down Expand Up @@ -605,11 +649,15 @@ def test_get_pets_none_value(self, spec):
with pytest.warns(
DeprecationWarning, match="limit parameter is deprecated"
):
result = unmarshal_request(
request,
spec=spec,
cls=V30RequestParametersUnmarshaller,
)
with pytest.warns(
DeprecationWarning,
match="Use of allowEmptyValue property is deprecated",
):
result = unmarshal_request(
request,
spec=spec,
cls=V30RequestParametersUnmarshaller,
)

assert result.parameters == Parameters(
query={
Expand Down Expand Up @@ -644,11 +692,15 @@ def test_get_pets_param_order(self, spec):
with pytest.warns(
DeprecationWarning, match="limit parameter is deprecated"
):
result = unmarshal_request(
request,
spec=spec,
cls=V30RequestParametersUnmarshaller,
)
with pytest.warns(
DeprecationWarning,
match="Use of allowEmptyValue property is deprecated",
):
result = unmarshal_request(
request,
spec=spec,
cls=V30RequestParametersUnmarshaller,
)

assert result.parameters == Parameters(
query={
Expand Down Expand Up @@ -688,11 +740,15 @@ def test_get_pets_param_coordinates(self, spec):
with pytest.warns(
DeprecationWarning, match="limit parameter is deprecated"
):
result = unmarshal_request(
request,
spec=spec,
cls=V30RequestParametersUnmarshaller,
)
with pytest.warns(
DeprecationWarning,
match="Use of allowEmptyValue property is deprecated",
):
result = unmarshal_request(
request,
spec=spec,
cls=V30RequestParametersUnmarshaller,
)

assert is_dataclass(result.parameters.query["coordinates"])
assert (
Expand Down