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

Alow Blueprint routes to explicitly define error_format #2773

Merged
merged 3 commits into from
Jul 9, 2023

Conversation

moshe742
Copy link
Contributor

@moshe742 moshe742 commented Jul 8, 2023

fix #2752

@moshe742 moshe742 requested a review from a team as a code owner July 8, 2023 19:08
@ahopkins
Copy link
Member

ahopkins commented Jul 9, 2023

Thank you @moshe742!

Can you also add a test for this? In ./tests/test_errorpages.py there is this test:

def test_route_error_response_from_explicit_format(app):
    ...

You can copy the test and just attach the routes to a Blueprint object instead like in the issue.

@ahopkins ahopkins changed the title fix #2752 Alow Blueprint routes to explicitly define error_format Jul 9, 2023
@codecov
Copy link

codecov bot commented Jul 9, 2023

Codecov Report

Patch coverage: 100.000% and project coverage change: +0.052 🎉

Comparison is base (e374409) 88.919% compared to head (f0b940c) 88.971%.

Additional details and impacted files
@@              Coverage Diff              @@
##              main     #2773       +/-   ##
=============================================
+ Coverage   88.919%   88.971%   +0.052%     
=============================================
  Files           92        92               
  Lines         6976      6991       +15     
  Branches      1190      1193        +3     
=============================================
+ Hits          6203      6220       +17     
+ Misses         529       527        -2     
  Partials       244       244               
Impacted Files Coverage Δ
sanic/blueprints.py 91.743% <100.000%> (+0.038%) ⬆️

... and 8 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@ahopkins ahopkins left a comment

Choose a reason for hiding this comment

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

Thanks for the help on this.

@ahopkins ahopkins merged commit 5dd1623 into sanic-org:main Jul 9, 2023
30 checks passed
@swheaton
Copy link

swheaton commented Jul 9, 2023

Thanks for fixing my reported issue! 🤩

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.

Blueprint ignores error_format option
3 participants