-
Notifications
You must be signed in to change notification settings - Fork 640
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
Add failing test for passing vars from parent macro to child macro. #917
base: master
Are you sure you want to change the base?
Conversation
I'm not sure that all those cases are allowed in Jinja2, Some older commits, like #667, clearly adding stronger isolation of child from parent scope. I guess to follow Jinja2 behavior better. It's still unclear for me, does Jinja2 allows directly passing down variables to childs from parents, like in tests, or only via arguments, like in 3 and 4 test cases of #912. Sorry @carljm for calling you once again, there isn't much Jinja2 experts around here :) |
@ArmorDarks I tested all of the cases in your example #912; they all work as expected in Jinja2. |
Don't need to be a Jinja2 expert to test its behavior :-) Usually for these edge cases (I've personally never nested a macro definition inside another macro in real uses) I don't know the behavior, I have to check it. Here are the scripts I use for comparing Jinja2 behavior to nunjucks behavior on rendering some template:
The first script requires that you first create a Python virtualenv, activate it, and then run |
I agree. They are quite probably related (IIRC effectively |
This PR simply adds a failing test for the most basic case of #912 (probably also related to #906).