Skip to content

Rewriting assertions in closure functions (i.e. function nested in another function) #8679

Answered by mboutet
mboutet asked this question in General
Discussion options

You must be logged in to vote

Ok, nevermind.

Rewritten assert statements put introspection information into the assertion failure message. pytest only rewrites test modules directly discovered by its test collection process, so asserts in supporting modules which are not themselves test modules will not be rewritten.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@RonnyPfannschmidt
Comment options

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