Iwana 20211114 t1305 pytestx by aucampia · Pull Request #1460 · RDFLib/rdflib (original) (raw)

@white-gecko @aucampia

@white-gecko @aucampia

@white-gecko @aucampia

@aucampia

This patch replace all uses of nose with pytest. It also includes a pytest plugin for creating EARL reports for tests with a rdf_test_uri parameter.

Some caveats:

Special thanks to Wes Turner for his advice and inputs on this process.

@aucampia

@aucampia

This eliminates this warning:

.venv/lib64/python3.7/site-packages/_pytest/config/__init__.py:676
/home/iwana/sw/d/github.com/iafork/rdflib/.venv/lib64/python3.7/site-packages/_pytest/config/__init__.py:676: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: test.earl
  self.import_plugin(import_spec)

By adding PYTEST_DONT_REWRITE to the plugin module docstring.

@aucampia

@aucampia

pytest's behaviour causes some spurious warnings during test, this commit configures pytest to ignore them.

@aucampia

Skipping was done incorrectly and failed on Windows.

@aucampia

@aucampia

This is so that it works properly on MacOS which does not permit listening on random loopback addresses for user processes.

@aucampia

Errors were being piped to true, but that will fail if it runs with pipefail. The better option is to do black ... || true which will work for ignoring errors even with pipefail.