Skip to content
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

test: fix pydantic@v2 deprecation warning in tests #2340

Merged
merged 4 commits into from
Sep 23, 2023
Merged

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Sep 23, 2023

It used to be:

tests/unit/test_openapi/test_schema.py::test_create_schema_for_pydantic_field
  /home/runner/work/litestar/litestar/.venv/lib/python3.11/site-packages/pydantic/fields.py:792: PydanticDeprecatedSince20: Using extra keyword arguments on `Field` is deprecated and will be removed. Use `json_schema_extra` instead. (Extra keys: 'example'). Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.3/migration/
    warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

Now the warning is gone.
Docs: https://docs.pydantic.dev/2.3/migration/#changes-to-pydanticfield
Closes #2341

@provinzkraut provinzkraut enabled auto-merge (squash) September 23, 2023 09:13
@sobolevn
Copy link
Member Author

@provinzkraut looks like codeql is broken. It is only run on schedule event now, but the CI thinks that it is still required.

I think that it should be disabled as a required check in CI or updated to be run on pull_request and push

@provinzkraut
Copy link
Member

@sobolevn It seems that the wrong CodeQL job was selected in the branch protection rules. I updated this. I think it should work now.

@sobolevn sobolevn enabled auto-merge (squash) September 23, 2023 09:35
@sonarcloud
Copy link

sonarcloud bot commented Sep 23, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sobolevn sobolevn merged commit 6c61f7a into main Sep 23, 2023
17 checks passed
@sobolevn sobolevn deleted the fix-pydantic-warning branch September 23, 2023 09:41
@sobolevn
Copy link
Member Author

Thanks!

@github-actions
Copy link

Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/2340

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants