-
Notifications
You must be signed in to change notification settings - Fork 27
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
assertRaises with context should replace context.exception with context.value #36
Comments
or maybe you could cheat and output with pytest.raises(Exception) as ctx:
sut()
ctx.exception = ctx.value # TODO: replace all uses of ctx.exception with ctx.value
assert "msg" in str(ctx.exception) |
This would required static code analysis. I considert this as "won't fix", but will keep it open for the case someone else is eager to pick it up. |
Might be worth updating pytest to provide a .exception property alias |
For easier compatibility with unittest pytest-dev/unittest2pytest#36
@htgoebel I believe this is the smallest code change to fix this issue: pytest-dev/pytest#5541 |
For easier compatibility with unittest pytest-dev/unittest2pytest#36
For easier compatibility with unittest pytest-dev/unittest2pytest#36 Co-Authored-By: Bruno Oliveira <[email protected]>
For easier compatibility with unittest pytest-dev/unittest2pytest#36 Co-Authored-By: Bruno Oliveira <[email protected]>
Lines 78 to 83 in 2c32cd6
|
I encountered this issue today. Did you consider emitting a warning when this condition is encountered? |
input
expected output
The text was updated successfully, but these errors were encountered: