summaryrefslogtreecommitdiff
path: root/test/testutils.py
Commit message (Collapse)AuthorAgeFilesLines
* Change mock HTTP server to listen on 127.0.0.1 by defaultIwan Aucamp2021-11-141-4/+4
| | | | | This is so that it works properly on MacOS which does not permit listening on random loopback addresses for user processes.
* Migrate from nosetest to pytestIwan Aucamp2021-10-241-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: - HTML report directory is now htmlcov instead of coverage - There is some warning related to the EARL reporting plugin which I can't quite figure out: ``` .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) ``` This is not causing any problems as far as I can tell, but still annoying. - python setup.py test won't work anymore, I can make it work but this is not advised by pytest: https://github.com/pytest-dev/pytest-runner/#deprecation-notice - run_test.py is still there but it's not really referenced anymore from anywhere and the options it accepts are completely different as it's options were based on nose. I would say it should be removed entirely but for now it is basically just a wrapper around pytest that basically does nothing. - Removed references to test attributes as currently they are not being used anywhere anyway, I guess we can add them back if there is some use for them later. - A lot of tests are still marked to skip when really they should be marked with xfail. This is also affecting the RDFT test manifests and result in reports saying tests are skipped when really we know they will fail and they are only skipped for this reason. But there is no change here from before, and pytest makes it easier to dynamically do expected failures. Special thanks to Wes Turner for his advice and inputs on this process.
* blacked everything6.0.0Nicholas Car2021-07-201-5/+12
|
* Merge branch 'master' into hsolbrig/masterEdmond Chuc2021-07-141-2/+42
|\ | | | | | | | | | | | | # Conflicts: # rdflib/namespace/__init__.py # rdflib/plugins/sparql/operators.py # test/test_namespace.py
| * Add unit tests for issue #1294 with @expectedFailureIwan Aucamp2021-07-131-0/+8
| | | | | | | | | | Also add type annotations to rdflib.compare to make it easier to understand the code.
| * Add unit test for #919 and more type hints for sparqlconnector and sparqlstoreIwan Aucamp2021-07-071-2/+34
| | | | | | | | Issue #919 is already fixed, this just confirms it.
* | Merge branch 'master' into hsolbrig/masterEdmond Chuc2021-07-081-0/+301
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # Conflicts: # rdflib/__init__.py # rdflib/compat.py # rdflib/namespace/__init__.py # rdflib/plugins/parsers/rdfxml.py # rdflib/plugins/serializers/rdfxml.py # rdflib/tools/csv2rdf.py # test/test_dawg.py # test/test_namespace.py # test/test_nt_misc.py # test/test_rdfxml.py # test/test_seq.py # test/test_trig.py # test/testutils.py
| * Replace use of DBPedia with the new SimpleHTTPMockIwan Aucamp2021-06-301-2/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | This should eliminate the spurious DBPedia related errors that plagued the CI pipeline. I am deleting `test/test_core_sparqlstore.py` as it does not do anything meaningful as far as I can tell and certainly nothing different from what is being done in `test/test_sparqlstore.py`. Also adds ServedSimpleHTTPMock to testutils.py which inherits from SimpleHTTPMock and adds a http server to it which makes it a bit less fiddly to use in tests.
| * Add handling for 308 (Permanent Redirect)Iwan Aucamp2021-06-241-1/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some/all supported versions of python does not handle 308 (Permanent Redirect) in `urlopen`. See https://bugs.python.org/issue40321 for more info on this. This patch adds handling for 308 in rdflib. I also extracted the HTTP mock from `test_sparqlstore.py` and reused it in test_conneg. Any feedback on it will be appreciated.
| * 2to3 whole sourcebaset0b32020-06-221-2/+0
| | | | | | | | Signed-off-by: t0b3 <thomas.bettler@gmail.com>
* | Refactor - module names don't match class nameshsolbrig2020-05-261-4/+8
| | | | | | | | | | For some reason the sequence of processing is different in Travis than in PyCharm. Changing the module names eliminates any possibility of confusion. Also fixed a number of warnings, whines and general unhappiness in the build process.
* | Migration from ClosedNamespace to DeclaredNamespacehsolbrig2020-05-261-1/+1
|/ | | | Passes all unit tests, but did have to remove '.' from manifest and earl imports. May have to restore...
* blacked all python filesNicholas Car2020-05-161-5/+11
|
* Remove colons from test result files. Fix #901.Natanael Arndt2020-03-151-1/+1
|
* a slightly opinionated autopep8 runGunnar Aastrand Grimnes2018-10-301-5/+9
| | | | | | | | opinions is mainly: no to long lines, but not at any cost. notation3.py crashses autopep :D Also rdflib/__init__.py gets completely broken
* converted all testsGunnar Aastrand Grimnes2017-01-301-15/+16
|
* fix importGunnar Aastrand Grimnes2013-12-221-1/+1
|
* moved earl report generation to separate file - added reporting to ↵Gunnar Aastrand Grimnes2013-12-221-0/+49
| | | | nq/nt/trig/ttl
* cleaned up tests, removed duplicates, more sensible namesgromgull2012-07-181-0/+49