-
Notifications
You must be signed in to change notification settings - Fork 555
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
6.2.0: pytest is failing #2035
Comments
Here is pytest output |
I will update our CI to run with lxml at least on some versions of python and then mark the failing tests with xfail. |
RDFLib has a bug which is tracked in #1847 - and because of this bug, using lxml with XML based SPARQL results fail. We should fix the bug, but we should also mark the tests in our test suite that are known to fail under some conditions with xfail under those conditions, so that the test suite still passes. For example: rdflib/test/test_w3c_spec/test_n3_w3c.py Lines 117 to 119 in d263009
This test is known to fail on windows, so we mark it with xfail on windows. Similarly, with lxml installed, the failing tests here should have an xfail marker. |
Thank you very much for the explanation 😄 |
Fixed the following problems with the SPARQL XML result parsing: - Both the parse method of both the lxml and `xml` modules does not work work well with `TextIO` objects, the `xml` module works with `TextIO` objects if the XML encoding is `utf-8`, but not if it is `utf-16`, and with `lxml` parse fails for both `utf-8` and `utf-16`. To fix this I changed the XML result parser to first convert `TextIO` to `bytes` and then feed the `bytes` to `parse()` using `BytesIO`. - The parser was operating on all elements inside `results` and `result` elements, even if those elements were not `result` and `binding` elements respectively. This was causing problems with `lxml`, as `lxml` also returns comments when iterating over elements. To fix this I added a check for the element tags so that only the correct elements are considered. Other changes: - Added type hints to `rdflib.plugins.sparql.results.xmlresults`. - Run with `lxml` one some permutations in the test matrix. - Removed `rdflib.compat.etree`, as this was not very helpful for the SPARQL XML Result parser and it was not used elsewhere. - Added an `lxml` environment to tox which installs `lxml` and `lxml-stubs`. - Expanded SPARQL result testing by adding some additional parameters. Related issues: - Fixes #2035 - Fixes #1847
I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
build
with--no-isolation
I'm using during all processes only locally installed modulesThe text was updated successfully, but these errors were encountered: