NatLibFi / Skosify

Validate, convert and improve SKOS vocabularies
http://skosify.readthedocs.io/
MIT License
55 stars 8 forks source link

Test collection not working with pytest 6+ #74

Closed osma closed 3 years ago

osma commented 4 years ago

I had to force the use of pytest<6.0.0 in setup.py because I couldn't get test collection to work with any 6.x version.

Here's what happens if I switch to pytest==6.1.1 and run python setup.py test:

==================================== test session starts =====================================
platform linux -- Python 3.7.9, pytest-6.1.1, py-1.9.0, pluggy-0.13.1 -- /home/local/oisuomin/git/Skosify/venv/bin/python
cachedir: .pytest_cache
rootdir: /home/local/oisuomin/git/Skosify, configfile: pytest.ini
plugins: pep8-1.0.6, cov-2.10.1, catchlog-1.2.2
collected 0 items / 1 error                                                                  
Coverage.py warning: No data was collected. (no-data-collected)

=========================================== ERRORS ===========================================
_______________________________ ERROR collecting test session ________________________________
Direct construction of Pep8Item has been deprecated, please use Pep8Item.from_parent.
See https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent for more details.

----------- coverage: platform linux, python 3.7.9-final-0 -----------
Name                            Stmts   Miss  Cover   Missing
-------------------------------------------------------------
skosify/__init__.py                 5      5     0%   2-7
skosify/check.py                   98     98     0%   2-197
skosify/cli.py                     92     92     0%   2-224
skosify/config.py                 100    100     0%   2-191
skosify/infer.py                   76     76     0%   2-133
skosify/rdftools/__init__.py        4      4     0%   2-6
skosify/rdftools/access.py          7      7     0%   2-14
skosify/rdftools/io.py             42     42     0%   2-66
skosify/rdftools/modify.py         53     53     0%   3-98
skosify/rdftools/namespace.py       2      2     0%   1-4
skosify/skosify.py                450    450     0%   3-845
-------------------------------------------------------------
TOTAL                             929    929     0%
Coverage XML written to file coverage.xml

================================== short test summary info ===================================
ERROR 
!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!
====================================== 1 error in 0.29s ======================================

Ideas (and PRs) welcome!

ppeczek commented 4 years ago

I have the same problem. Have you found out which requirement causes the error?

osma commented 4 years ago

@ppeczek No, sorry. For now I just selected a 5.x version of pytest where everything works. It could be related to the naming of test files and folders, I didn't investigate very deeply.