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

Resolve edge case in nested BP Groups #2592

Merged
merged 3 commits into from
Oct 31, 2022
Merged

Conversation

ahopkins
Copy link
Member

There is an edge case where nested BP groups where the inner groups have no url_prefix behave unexpected.

app = Sanic("TestApp")
app.config.AUTO_EXTEND = False

one = Blueprint("one", url_prefix="/one")


@one.get("/func")
async def func(req):
    ...


two = Blueprint.group(one)
three = Blueprint.group(two, url_prefix="three")
app.blueprint(three)

In this situation, the outer group prefix would not be unexpectedly ignored.

@ahopkins ahopkins requested a review from a team as a code owner October 28, 2022 06:15
@codecov
Copy link

codecov bot commented Oct 28, 2022

Codecov Report

Base: 88.097% // Head: 88.022% // Decreases project coverage by -0.074% ⚠️

Coverage data is based on head (2ef4252) compared to base (65d7447).
Patch has no changes to coverable lines.

Additional details and impacted files
@@              Coverage Diff              @@
##              main     #2592       +/-   ##
=============================================
- Coverage   88.097%   88.022%   -0.075%     
=============================================
  Files           71        71               
  Lines         5335      5335               
  Branches       893       893               
=============================================
- Hits          4700      4696        -4     
- Misses         459       461        +2     
- Partials       176       178        +2     
Impacted Files Coverage Δ
sanic/server/websockets/impl.py 37.115% <0.000%> (-0.946%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

prryplatypus
prryplatypus previously approved these changes Oct 28, 2022
Copy link
Member

@prryplatypus prryplatypus left a comment

Choose a reason for hiding this comment

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

Might want to add a test to avoid regressions

@ahopkins
Copy link
Member Author

I plan to. Meant for this to be in draft mode.

@prryplatypus prryplatypus marked this pull request as draft October 28, 2022 08:28
@prryplatypus
Copy link
Member

Marked as draft for you :P

@ahopkins ahopkins marked this pull request as ready for review October 31, 2022 10:04
@ahopkins ahopkins merged commit 3f4663b into main Oct 31, 2022
@ahopkins ahopkins deleted the bpg-edge-case-url-prefix branch October 31, 2022 10:58
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