Closed kloczek closed 2 years ago
The changes in #187 should ensure this works. Let me know if there's still an issue.
Just tested 7.7.0 and test suite still fails. I'm using latest sphinx 6.1.3 Here is pytest output:
@kloczek which git sha did you check out? I can't reproduce this with the sdist tagged 7.7.0.
virtualenv venv
source venv/bin/activate
tar zxf sphinxcontrib-spelling-7.7.0.tar.gz
cd ./sphinxcontrib-spelling-7.7.0
pip install .[test]
pytest -ra -m 'not network'
produces this output from pytest
============================================ test session starts =============================================
platform darwin -- Python 3.10.4, pytest-7.2.1, pluggy-1.0.0
rootdir: /Users/dhellmann/Devel/sphinxcontrib-spelling/isolated-tests/sphinxcontrib-spelling-7.7.0
plugins: cov-4.0.0
collected 66 items
tests/test_builder.py ..........s............ [ 34%]
tests/test_checker.py ...... [ 43%]
tests/test_filter.py ....sssssssssssssssssssssssssss...... [100%]
============================================== warnings summary ==============================================
tests/test_builder.py: 11 warnings
/Users/dhellmann/Devel/sphinxcontrib-spelling/isolated-tests/sphinxcontrib-spelling-7.7.0/sphinxcontrib/spelling/builder.py:217: PendingDeprecationWarning: nodes.Node.traverse() is obsoleted by Node.findall().
for node in doctree.traverse(docutils.nodes.Text):
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================== short test summary info ===========================================
SKIPPED [1] tests/test_builder.py:257: Not a git repo
SKIPPED [27] tests/test_filter.py:49: Not a git repo
================================ 38 passed, 28 skipped, 11 warnings in 0.83s =================================
for
$ pytest --version
pytest 7.2.1
@kloczek which git sha did you check out? I can't reproduce this with the sdist tagged 7.7.0.
virtualenv venv source venv/bin/activate tar zxf sphinxcontrib-spelling-7.7.0.tar.gz cd ./sphinxcontrib-spelling-7.7.0 pip install .[test] pytest -ra -m 'not network'
You forgot about few steps which I've described opening ticket.
python3 -sBm build -w --no-isolation
build
with --no-isolation
I'm using during all processes only locally installed modulesThat is how most of the modles are tested in fedora and Debian as well on packaging.
About your question what I'm using as as input resource I'm using autogenerated tat ball from version git tag.
Using the archive just created for release 7.7.2, I ran
virtualenv venv
source venv/bin/activate
pip install pytest build setuptools_scm
tar zxf spelling-7.7.2.tar.gz
cd ./spelling-7.7.2
python3 -sBm build -w --no-isolation
pip install dist/sphinxcontrib_spelling-7.7.2-py3-none-any.whl
python -m pytest -ra -m 'not network'
and all of the tests run cleanly
$ python -m pytest -ra -m 'not network'
============================================ test session starts =============================================
platform darwin -- Python 3.10.4, pytest-7.2.1, pluggy-1.0.0
rootdir: /Users/dhellmann/Devel/sphinxcontrib-spelling/isolation-test/spelling-7.7.2
collected 67 items
tests/test_builder.py ..........s............. [ 35%]
tests/test_checker.py ...... [ 44%]
tests/test_filter.py ....sssssssssssssssssssssssssss...... [100%]
========================================== short test summary info ===========================================
SKIPPED [1] tests/test_builder.py:257: Not a git repo
SKIPPED [27] tests/test_filter.py:49: Not a git repo
======================================= 39 passed, 28 skipped in 0.72s =======================================
The main difference is using python -m pytest
instead of just pytest
. I believe that's necessary because the tests directory is no longer part of the sdist, and is therefore not installed into the site-packages.
The main difference is using
python -m pytest
instead of justpytest
. I believe that's necessary because the tests directory is no longer part of the sdist, and is therefore not installed into the site-packages.
pytest should never be used that way and pytest
maintainers told about that maaaaany times.
Issu is that if it is used pythinn -m foo
python interpreter always adds current directry to sys.path
.
This is why it is provided pytest
wrapper script.
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 modulesHere is pytest output:
Here is list of installed modules in build env