Skip to content

Assertion rewrites not applied when running pytest within an embedded Python environment #12454

Answered by The-Compiler
bradleyharden asked this question in Q&A
Discussion options

You must be logged in to vote

I'm confused why you think this is related to assertion rewriting. An assert False should cause an AssertionError in Python - rewritten or not, and even outside of pytest. All rewriting does is showing additional context when the assertion fails.

It sounds like something is broken in your Python environment. Possibly you're using PYTHONOPTIMIZE / -O?

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@bradleyharden
Comment options

@bradleyharden
Comment options

@bradleyharden
Comment options

@bradleyharden
Comment options

@bradleyharden
Comment options

Answer selected by bradleyharden
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants