Closed kloczek closed 2 years ago
Definitely! This work was already performed in the parent project, and would need a volunteer for it to take place here as well. In GitPython, it worked without any hassle as I have been told.
nose
is for python 2.x
Nose runs on Python 3 just fine - but it should be replaced for other reasons (namely, being dead).
Note that pytest supports running nose-style tests - from a very quick try, that includes gitdb's:
============================= test session starts ==============================
platform linux -- Python 3.10.1, pytest-6.2.5, py-1.11.0, pluggy-0.13.1
rootdir: /home/florian/tmp/gitdb
plugins: hypothesis-6.17.0, anyio-3.4.0
collected 24 items
gitdb/test/test_base.py . [ 4%]
gitdb/test/test_example.py . [ 8%]
gitdb/test/test_pack.py .s.. [ 25%]
gitdb/test/test_stream.py .... [ 41%]
gitdb/test/test_util.py .. [ 50%]
gitdb/test/db/test_git.py .. [ 58%]
gitdb/test/db/test_loose.py . [ 62%]
gitdb/test/db/test_mem.py . [ 66%]
gitdb/test/db/test_pack.py . [ 70%]
gitdb/test/db/test_ref.py . [ 75%]
gitdb/test/performance/test_pack.py ... [ 87%]
gitdb/test/performance/test_pack_streaming.py .. [ 95%]
gitdb/test/performance/test_stream.py . [100%]
=============================== warnings summary ===============================
../../../../usr/lib/python3.10/site-packages/packaging/version.py:127: 2850 warnings
/usr/lib/python3.10/site-packages/packaging/version.py:127: DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the next major release
warnings.warn(
../../../../usr/lib/python3.10/site-packages/nose/importer.py:12
/usr/lib/python3.10/site-packages/nose/importer.py:12: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
from imp import find_module, load_module, acquire_lock, release_lock
-- Docs: https://docs.pytest.org/en/stable/warnings.html
================ 23 passed, 1 skipped, 2851 warnings in 15.47s =================
I'd still recommend rewriting the tests themselves (perhaps via nose2pytest), but that can be a more gradual process too. As for the warnings, those are coming from nose
importing pkg_resources
on my system - YMMV, and you could ignore them.
nose
is for python 2.x and should be replaced bypytest
,nose2
orunittest2
https://docs.nose2.io/en/latest/differences.html