WordPress / openverse

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
https://openverse.org
MIT License
254 stars 203 forks source link

Bump schemathesis to 3.38.6 and silence its warning #5166

Closed krysal closed 4 days ago

krysal commented 6 days ago

Fixes

Fixes several warnings that appear when running tests.

../.venv/lib/python3.12/site-packages/schemathesis/generation/coverage.py:279
  /.venv/lib/python3.12/site-packages/schemathesis/generation/coverage.py:279: DeprecationWarning: jsonschema.exceptions.RefResolutionError is deprecated as of version 4.18.0. If you wish to catch potential reference resolution errors, directly catch referencing.exceptions.Unresolvable.
    ref_error: type[Exception] = jsonschema.RefResolutionError,

test/integration/test_auth.py:38
  /api/test/integration/test_auth.py:38: PytestRemovedIn9Warning: Marks applied to fixtures have no effect
  See docs: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function
    @pytest.mark.django_db

...

../.venv/lib/python3.12/site-packages/schemathesis/specs/openapi/references.py:11
  /.venv/lib/python3.12/site-packages/schemathesis/specs/openapi/references.py:11: DeprecationWarning: jsonschema.exceptions.RefResolutionError is deprecated as of version 4.18.0. If you wish to catch potential reference resolution errors, directly catch referencing.exceptions.Unresolvable.
    from jsonschema.exceptions import RefResolutionError

Description

Updating schemathesis didn't resolve the warnings, so I marked to ignore them, with the removal of one entry that is resolved with the Django upgrade to v5.

Testing Instructions

  1. In main, run the tests and observe the warnings.
    just api/test
  2. In this branch, recreate the stack, run the tests again, and observe that the previous warnings are gone.
    just recreate && just api/test

Checklist

[best_practices]: https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#_commit_guidelines

Developer Certificate of Origin

Developer Certificate of Origin ``` Developer Certificate of Origin Version 1.1 Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 1 Letterman Drive Suite D4700 San Francisco, CA, 94129 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. ```
krysal commented 4 days ago

@dhruvkb Oddly enough, the file already had that spacing difference. It would be better to homogenize it with the rest of the project. Thanks for mentioning it and the quick review!