-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Unable to test a Flask app with default (rewritting) assertions #317
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
Comments
Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt): got a unfinished patch that i need to reiterate |
Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42): Not sure i understand how this error comes along. The Loader is not something that Flask influences, or does it? Will wait for @RonnyPfannschmidt -- it's defintely high priority to make flask interactions work out of the box. UPDATED: now i understand, this is all Flask's code - didn't notice because the traceback was truncated. So this is an issue of pytest's Loader not supporting the right interface? |
Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt): correct, we are missing is_package, i need to reiterate my patch on that |
Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt): fix issue317: assertion rewriter support for the is_package method |
Originally reported by: Sean Lynch (BitBucket: techniq, GitHub: techniq)
Due to how Flask determines it's instance_path (http://flask.pocoo.org/docs/config/#instance-folders), py.test will throw the following error on a simple test
Test
Results / error
The solution is simple (as outlined in the docs: http://pytest.org/latest/assert.html#advanced-assertion-introspection), pass
assert=reinterp
orassert=plain
when running the test.While not a major issue, it would be great if py.test could test a Flask app without needing to know this knowledge, either by gracefully degrading assertions from module rewriting to reinterp by default, or somehow fixing the root issue of module rewriting with what Flask expects.
Thoughts?
The text was updated successfully, but these errors were encountered: