pytest 2.6.0 release
Briefly

pytest 2.6.0 release
"In July, bluenote10 reported that check.raises() doesn't behave like pytest.raises() in that the AssertionError returned from check.raises() doesn't have a queryable value. Example of pytest.raises(): with pytest.raises(Exception) as e: do_something() assert str(e.value) == "" We'd like check.raises() to act similarly: with check.raises(Exception) as e: do_something() assert str(e.value) == "" But that didn't work prior to 2.6.0. The issue was that the value returned from check.raises() didn't have any .value atribute."
"The fix This is fixed in 2.6.0, thanks to shairoth12. The fix is elegant, and seems simple, now that I see it. Just make sure the return value has a value property and upon exiting the context manager, assign self.value = exc_val. Nice. See the PR #188 if you'd like to see the change. Shai included implementation, elegant test code, updates to the README, and updates to the changelog I appreciate the community effort."
pytest-check 2.6.0 modifies check.raises() so the returned context manager exposes a .value attribute containing the caught exception. Previously, check.raises() returned an object without a .value attribute, preventing queries such as str(e.value) after the context. The change assigns self.value = exc_val when exiting the context manager, aligning behavior with pytest.raises(). The fix was implemented by shairoth12 and includes implementation code, tests, README updates, and changelog entries. The release contains only this change and received a minor version bump to 2.6.0 due to the interface change.
Read at pythontest.com
Unable to calculate read time
[
|
]