Closed
Description
Sometimes users do some "black magic" like patching builtins (for example #2180) and that might completely break pytest.
While of course we should not encourage too much black magic, I was wondering if we could alleviate the problem for users which don't want or can't change their tests to disable assertion rewriting for some of the test modules.
I was thinking of something like the # encoding
comment used by Python to declare the encoding of a file. An alternative would be to list some test files on pytest.ini
, but I think the comment is better because it is written in the file itself, rather than far away from it.
How about # pytest-no-rewrite
or something like this?