Merge pull request #9399 from The-Compiler/backport-9394

[7.0.x] Hide internal stack when using pytest.approx() in bool context (#9394)
This commit is contained in:
Bruno Oliveira 2021-12-08 07:50:11 -03:00 committed by GitHub
commit 813e1e5b54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -101,6 +101,7 @@ class ApproxBase:
) )
def __bool__(self): def __bool__(self):
__tracebackhide__ = True
raise AssertionError( raise AssertionError(
"approx() is not supported in a boolean context.\nDid you mean: `assert a == approx(b)`?" "approx() is not supported in a boolean context.\nDid you mean: `assert a == approx(b)`?"
) )