Skip to content

Alow Blueprint routes to explicitly define error_format#2773

Merged
ahopkins merged 3 commits into
sanic-org:mainfrom
moshe742:main
Jul 9, 2023
Merged

Alow Blueprint routes to explicitly define error_format#2773
ahopkins merged 3 commits into
sanic-org:mainfrom
moshe742:main

Conversation

@moshe742

@moshe742 moshe742 commented Jul 8, 2023

Copy link
Copy Markdown
Contributor

fix #2752

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

ahopkins commented Jul 9, 2023

Copy link
Copy Markdown
Member

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

codecov Bot commented Jul 9, 2023

Copy link
Copy Markdown

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.

@ahopkins ahopkins left a comment

Copy link
Copy Markdown
Member

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
@swheaton

swheaton commented Jul 9, 2023

Copy link
Copy Markdown

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