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

Make validator raise for status #1864

Merged
merged 2 commits into from
Jun 26, 2023
Merged

Conversation

krivard
Copy link
Contributor

@krivard krivard commented Jun 23, 2023

Description

Type of change (bug fix, new feature, etc), brief description, and motivation for these changes.

  • makes validator raise for status when encountering server errors instead of trying to parse the server error as JSON
  • adds requests-mock library, which seems worth it
  • leaves TODOs to convert the remaining manual requests mocks

Changelog

Itemize code/test/documentation changes and files added/removed.

  • validator datafetcher.py: raise_for_status on all requests
  • status.py: include requests-mock library
  • tests/validator/test_datafetcher.py: use requests-mock to properly mock a request that fails with an HTTP error code; ensure such responses are handled properly by the datafetcher code

Fixes

  • Fixes bad error messages from validator when encountering server errors

* adds requests-mock library, which seems worth it
* leaves TODOs to convert the remaining manual requests mocks
Copy link
Contributor

@rzats rzats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@krivard krivard merged commit fe64a84 into main Jun 26, 2023
13 checks passed
@krivard krivard deleted the krivard/validator-requests-raise branch June 26, 2023 14:41
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.

3 participants