-
Notifications
You must be signed in to change notification settings - Fork 344
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 sure InvalidVarException.fail is reset #1076
Make sure InvalidVarException.fail is reset #1076
Conversation
c13d7da
to
bed7b43
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch @xavfernandez, I'm surprised no one had noticed this bug before.
I left a suggestion for simplifying the test.
Also, scrolling up a bit I see that _fail_for_invalid_template_variable
has a similar issue, although it's less consequential since it's a session
fixture. But it would be good to fix it as well.
tests/test_environment.py
Outdated
def test_invalid_template_variable_marker_cleanup(django_testdir) -> None: | ||
django_testdir.create_app_file( | ||
""" | ||
from django.urls import path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will be easier to have the tests render the template directly using e.g. render_to_string
instead of setting up views and requests and everything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test updated
after a test using ignore_template_errors marker
bed7b43
to
787ceef
Compare
I also added cleanup to |
c9c29aa
to
e71523a
Compare
e71523a
to
86a93e7
Compare
714dd8f
to
e9db1b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
pytest-dev/pytest-django#1076 has been merged & released (in 4.6.0).
pytest-dev/pytest-django#1076 has been merged & released (in 4.6.0).
after a test using ignore_template_errors marker.
Otherwise, the first test set
fail
toFalse
, never to be changed again.