-
Notifications
You must be signed in to change notification settings - Fork 560
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
TypeErrors from Results do not propagate through list creation #1523
TypeErrors from Results do not propagate through list creation #1523
Conversation
Still working my way through understanding all this code... Looking good so far but I just want to ensure I'm across it all before approving! |
No worries, I will look at fixing it when I get time, the problem is quite weird and I'm not entirely sure what the best approach to fixing it is, I think it may be to add some state in the result object but there may be more elegant fixed. |
So I guess this will appear in the testing logs as an xfail, but how will we indicate, in testing logs, which xfails are expected to always fail versus things which are known failures but which should be fixed? |
This is in line with pytest intent also, from pytest docs: Skip and xfail: dealing with tests that cannot succeed
The name is a bit unfortunate, because in practice is more a known failure than an expected failure, it is actually quite the opposite of an expected failure, but I guess the name is somewhat of a legacy carryover. In cases where the correct behaviour is that an exception gets thrown, we should use Once this problem of exceptions not propagating through list creation is fixed this will report as xpass unless the xfail marker is removed from it. The benefit of having tests marked with xfail for known issues is:
|
4e8b595
to
38c0ff5
Compare
38c0ff5
to
d7d2df4
Compare
Will re-check these when I have some time, the tests fail now but they really should not, so may be a regression. |
d7d2df4
to
6ccd022
Compare
Creating a list from from a query result that generates a `TypeError` succeeds and returns an empty list. The correct behaviour would be that the TypeError propagates through the list constuctor and that no list is created so that the caller can be aware that an error occured and that the caller does not get a seemingly okay list object which does not contain the result of the executed query. This patch adds some tests for SPARQL, including expected failure tests that demonstrate the problem of TypeErrors not propagating through list constructor.
6ccd022
to
aab1ea8
Compare
Problem was due to how CUSTOM_EVAL was referenced, passes now. |
Creating a list from from a query result that generates a
TypeError
succeeds and returns an empty list.
The correct behaviour would be that the TypeError propagates through the
list constuctor and that no list is created so that the caller can be
aware that an error occured and that the caller does not get a seemingly
okay list object which does not contain the result of the executed
query.
This patch adds some tests for SPARQL, including expected failure tests
that demonstrate the problem of TypeErrors not propagating through
list constructor.
For clarity, this adds an xfail for a known bug, once the bug is fixed the tests will be reported as xpass (unexpected pass) and someone should then remove the xfail marker.