-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8.0.0: pytest is failing #215
Comments
gentle ping 🤔 |
What are the contents of the directory where you're running the tests. The tox target |
I'm executing pytest in source root directory. Here is pytest output:+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-sphinxcontrib-spelling-8.0.0-2.fc36.x86_64/usr/lib64/python3.9/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-sphinxcontrib-spelling-8.0.0-2.fc36.x86_64/usr/lib/python3.9/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.9.18, pytest-8.1.1, pluggy-1.4.0
rootdir: /home/tkloczko/rpmbuild/BUILD/spelling-8.0.0
configfile: pyproject.toml
plugins: mock-3.12.0
collected 67 items
tests/test_builder.py ...F......s....FFFF.FF.. [ 35%]
tests/test_checker.py FFFF.. [ 44%]
tests/test_filter.py ....sssssssssssssssssssssssssss...... [100%]
========================================================================================= FAILURES ==========================================================================================
___________________________________________________________________________________ test_ignore_literals ____________________________________________________________________________________
sphinx_project = (local('/tmp/pytest-of-tkloczko/pytest-66/test_ignore_literals0/src'), local('/tmp/pytest-of-tkloczko/pytest-66/test_ignore_literals0/out'))
def test_ignore_literals(sphinx_project):
srcdir, outdir = sphinx_project
add_file(srcdir, 'contents.rst', '''
Welcome to Spelling Checker documentation!
==========================================
There are several misspelled words in this text.
::
Literal blocks are ignoreed.
Inline ``litterals`` are ignored, too.
''')
stdout, stderr, output_text = get_sphinx_output(srcdir, outdir, 'contents')
# The 'contents.spelling' output file should not have been
# created, because the errors are ignored.
> assert output_text is None
E AssertionError: assert '../../../../../tmp/pytest-of-tkloczko/pytest-66/test_ignore_literals0/src/contents.rst:3: (Welcome) Welcome to Spell...../../../../../tmp/pytest-of-tkloczko/pytest-66/test_ignore_literals0/src/contents.rst:11: (too) are ignored, too.\n' is None
tests/test_builder.py:138: AssertionError
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
fatal: not a git repository (or any parent up to mount point /home/tkloczko)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
------------------------------------------------------------------------------------- Captured log call -------------------------------------------------------------------------------------
WARNING test.filters:filters.py:249 Called: git log --quiet --no-color --pretty=format:%(trailers:key=Co-Authored-By,separator=%x0A)%x0A%an%x0A%cn
WARNING test.filters:filters.py:250 Failed to scan contributors: Command '['git', 'log', '--quiet', '--no-color', '--pretty=format:%(trailers:key=Co-Authored-By,separator=%x0A)%x0A%an%x0A%cn']' returned non-zero exit status 128.
___________________________________________________________________________________ test_legacy_directive ___________________________________________________________________________________
sphinx_project = (local('/tmp/pytest-of-tkloczko/pytest-66/test_legacy_directive0/src'), local('/tmp/pytest-of-tkloczko/pytest-66/test_legacy_directive0/out'))
def test_legacy_directive(sphinx_project):
srcdir, outdir = sphinx_project
add_file(srcdir, 'contents.rst', '''
The Module
==========
.. spelling::
teh
teh is OK
''')
stdout, stderr, output_text = get_sphinx_output(
srcdir,
outdir,
'contents',
)
> assert output_text is None
E AssertionError: assert '../../../../../tmp/pytest-of-tkloczko/pytest-66/test_legacy_directive0/src/contents.rst:3: (The) The Module\n../../....e Module\n../../../../../tmp/pytest-of-tkloczko/pytest-66/test_legacy_directive0/src/contents.rst:9: (is) teh is OK\n' is None
tests/test_builder.py:386: AssertionError
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
fatal: not a git repository (or any parent up to mount point /home/tkloczko)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
------------------------------------------------------------------------------------- Captured log call -------------------------------------------------------------------------------------
WARNING test.filters:filters.py:249 Called: git log --quiet --no-color --pretty=format:%(trailers:key=Co-Authored-By,separator=%x0A)%x0A%an%x0A%cn
WARNING test.filters:filters.py:250 Failed to scan contributors: Command '['git', 'log', '--quiet', '--no-color', '--pretty=format:%(trailers:key=Co-Authored-By,separator=%x0A)%x0A%an%x0A%cn']' returned non-zero exit status 128.
___________________________________________________________________________________ test_domain_directive ___________________________________________________________________________________
sphinx_project = (local('/tmp/pytest-of-tkloczko/pytest-66/test_domain_directive0/src'), local('/tmp/pytest-of-tkloczko/pytest-66/test_domain_directive0/out'))
def test_domain_directive(sphinx_project):
srcdir, outdir = sphinx_project
add_file(srcdir, 'contents.rst', '''
The Module
==========
.. spelling:word-list::
teh
teh is OK
''')
stdout, stderr, output_text = get_sphinx_output(
srcdir,
outdir,
'contents',
)
> assert output_text is None
E AssertionError: assert '../../../../../tmp/pytest-of-tkloczko/pytest-66/test_domain_directive0/src/contents.rst:3: (The) The Module\n../../....e Module\n../../../../../tmp/pytest-of-tkloczko/pytest-66/test_domain_directive0/src/contents.rst:9: (is) teh is OK\n' is None
tests/test_builder.py:409: AssertionError
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
fatal: not a git repository (or any parent up to mount point /home/tkloczko)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
------------------------------------------------------------------------------------- Captured log call -------------------------------------------------------------------------------------
WARNING test.filters:filters.py:249 Called: git log --quiet --no-color --pretty=format:%(trailers:key=Co-Authored-By,separator=%x0A)%x0A%an%x0A%cn
WARNING test.filters:filters.py:250 Failed to scan contributors: Command '['git', 'log', '--quiet', '--no-color', '--pretty=format:%(trailers:key=Co-Authored-By,separator=%x0A)%x0A%an%x0A%cn']' returned non-zero exit status 128.
_____________________________________________________________________________________ test_domain_role ______________________________________________________________________________________
sphinx_project = (local('/tmp/pytest-of-tkloczko/pytest-66/test_domain_role0/src'), local('/tmp/pytest-of-tkloczko/pytest-66/test_domain_role0/out'))
def test_domain_role(sphinx_project):
srcdir, outdir = sphinx_project
add_file(srcdir, 'contents.rst', '''
The Module
==========
:spelling:word:`teh` is OK
''')
stdout, stderr, output_text = get_sphinx_output(
srcdir,
outdir,
'contents',
)
> assert output_text is None
E AssertionError: assert '../../../../../tmp/pytest-of-tkloczko/pytest-66/test_domain_role0/src/contents.rst:3: (The) The Module\n../../../../...ule) The Module\n../../../../../tmp/pytest-of-tkloczko/pytest-66/test_domain_role0/src/contents.rst:5: (is) is OK\n' is None
tests/test_builder.py:428: AssertionError
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
fatal: not a git repository (or any parent up to mount point /home/tkloczko)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
------------------------------------------------------------------------------------- Captured log call -------------------------------------------------------------------------------------
WARNING test.filters:filters.py:249 Called: git log --quiet --no-color --pretty=format:%(trailers:key=Co-Authored-By,separator=%x0A)%x0A%an%x0A%cn
WARNING test.filters:filters.py:250 Failed to scan contributors: Command '['git', 'log', '--quiet', '--no-color', '--pretty=format:%(trailers:key=Co-Authored-By,separator=%x0A)%x0A%an%x0A%cn']' returned non-zero exit status 128.
______________________________________________________________________________ test_domain_role_multiple_words ______________________________________________________________________________
sphinx_project = (local('/tmp/pytest-of-tkloczko/pytest-66/test_domain_role_multiple_word0/src'), local('/tmp/pytest-of-tkloczko/pytest-66/test_domain_role_multiple_word0/out'))
def test_domain_role_multiple_words(sphinx_project):
srcdir, outdir = sphinx_project
add_file(srcdir, 'contents.rst', '''
The Module
==========
:spelling:word:`teh is KO`
''')
stdout, stderr, output_text = get_sphinx_output(
srcdir,
outdir,
'contents',
)
> assert output_text is None
E AssertionError: assert '../../../../../tmp/pytest-of-tkloczko/pytest-66/test_domain_role_multiple_word0/src/contents.rst:3: (The) The Module..../../../../tmp/pytest-of-tkloczko/pytest-66/test_domain_role_multiple_word0/src/contents.rst:3: (Module) The Module\n' is None
tests/test_builder.py:447: AssertionError
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
fatal: not a git repository (or any parent up to mount point /home/tkloczko)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
------------------------------------------------------------------------------------- Captured log call -------------------------------------------------------------------------------------
WARNING test.filters:filters.py:249 Called: git log --quiet --no-color --pretty=format:%(trailers:key=Co-Authored-By,separator=%x0A)%x0A%an%x0A%cn
WARNING test.filters:filters.py:250 Failed to scan contributors: Command '['git', 'log', '--quiet', '--no-color', '--pretty=format:%(trailers:key=Co-Authored-By,separator=%x0A)%x0A%an%x0A%cn']' returned non-zero exit status 128.
____________________________________________________________________________________ test_domain_ignore _____________________________________________________________________________________
sphinx_project = (local('/tmp/pytest-of-tkloczko/pytest-66/test_domain_ignore0/src'), local('/tmp/pytest-of-tkloczko/pytest-66/test_domain_ignore0/out'))
def test_domain_ignore(sphinx_project):
srcdir, outdir = sphinx_project
add_file(srcdir, 'contents.rst', '''
The Module
==========
:spelling:ignore:`baddddd` is OK
''')
stdout, stderr, output_text = get_sphinx_output(
srcdir,
outdir,
'contents',
)
> assert output_text is None
E AssertionError: assert '../../../../../tmp/pytest-of-tkloczko/pytest-66/test_domain_ignore0/src/contents.rst:3: (The) The Module\n../../../....e) The Module\n../../../../../tmp/pytest-of-tkloczko/pytest-66/test_domain_ignore0/src/contents.rst:5: (is) is OK\n' is None
tests/test_builder.py:494: AssertionError
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
fatal: not a git repository (or any parent up to mount point /home/tkloczko)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
------------------------------------------------------------------------------------- Captured log call -------------------------------------------------------------------------------------
WARNING test.filters:filters.py:249 Called: git log --quiet --no-color --pretty=format:%(trailers:key=Co-Authored-By,separator=%x0A)%x0A%an%x0A%cn
WARNING test.filters:filters.py:250 Failed to scan contributors: Command '['git', 'log', '--quiet', '--no-color', '--pretty=format:%(trailers:key=Co-Authored-By,separator=%x0A)%x0A%an%x0A%cn']' returned non-zero exit status 128.
_____________________________________________________________________________ test_domain_ignore_multiple_words _____________________________________________________________________________
sphinx_project = (local('/tmp/pytest-of-tkloczko/pytest-66/test_domain_ignore_multiple_wo0/src'), local('/tmp/pytest-of-tkloczko/pytest-66/test_domain_ignore_multiple_wo0/out'))
def test_domain_ignore_multiple_words(sphinx_project):
srcdir, outdir = sphinx_project
add_file(srcdir, 'contents.rst', '''
The Module
==========
:spelling:ignore:`baddddd` is OK here.
But, baddddd is not OK here.
Nor, here baddddd.
''')
stdout, stderr, output_text = get_sphinx_output(
srcdir,
outdir,
'contents',
)
assert '(baddddd)' in output_text
> assert output_text.count('\n') == 2 # Only expect 2 errors, not 3.
E AssertionError: assert 12 == 2
E + where 12 = <built-in method count of str object at 0x555a7971ad00>('\n')
E + where <built-in method count of str object at 0x555a7971ad00> = '../../../../../tmp/pytest-of-tkloczko/pytest-66/test_domain_ignore_multiple_wo0/src/contents.rst:3: (The) The Module..../tmp/pytest-of-tkloczko/pytest-66/test_domain_ignore_multiple_wo0/src/contents.rst:8: (baddddd) Nor, here baddddd.\n'.count
tests/test_builder.py:517: AssertionError
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
fatal: not a git repository (or any parent up to mount point /home/tkloczko)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
------------------------------------------------------------------------------------- Captured log call -------------------------------------------------------------------------------------
WARNING test.filters:filters.py:249 Called: git log --quiet --no-color --pretty=format:%(trailers:key=Co-Authored-By,separator=%x0A)%x0A%an%x0A%cn
WARNING test.filters:filters.py:250 Failed to scan contributors: Command '['git', 'log', '--quiet', '--no-color', '--pretty=format:%(trailers:key=Co-Authored-By,separator=%x0A)%x0A%an%x0A%cn']' returned non-zero exit status 128.
_____________________________________________________________________________________ test_errors_only ______________________________________________________________________________________
def test_errors_only():
checker = SpellingChecker(lang='en_US',
suggest=False,
word_list_filename=None,
)
for word, suggestions, line, offset in checker.check('This txt is wrong'):
assert not suggestions, 'Suggesting'
> assert word == 'txt'
E AssertionError: assert 'This' == 'txt'
E
E - txt
E + This
tests/test_checker.py:19: AssertionError
___________________________________________________________________________________ test_with_suggestions ___________________________________________________________________________________
def test_with_suggestions():
checker = SpellingChecker(lang='en_US',
suggest=True,
word_list_filename=None,
)
for word, suggestions, line, offset in checker.check('This txt is wrong'):
> assert suggestions, 'Not suggesting'
E AssertionError: Not suggesting
E assert []
tests/test_checker.py:30: AssertionError
____________________________________________________________________________________ test_with_wordlist _____________________________________________________________________________________
def test_with_wordlist():
checker = SpellingChecker(
lang='en_US',
suggest=False,
word_list_filename=os.path.join(os.path.dirname(__file__),
'test_wordlist.txt')
)
words = [w for w, s, l, o in checker.check('This txt is wrong')]
> assert not words, 'Did not use personal word list file'
E AssertionError: Did not use personal word list file
E assert not ['This', 'is', 'wrong']
tests/test_checker.py:43: AssertionError
__________________________________________________________________________________ test_with_context_line ___________________________________________________________________________________
def test_with_context_line():
checker = SpellingChecker(lang='en_US',
suggest=False,
word_list_filename=None,
context_line=True,
)
text = 'Line one\nThis txt is wrong\nLine two'
for word, suggestions, line, offset in checker.check(text):
assert not suggestions, 'Suggesting'
> assert word == 'txt'
E AssertionError: assert 'Line' == 'txt'
E
E - txt
E + Line
tests/test_checker.py:56: AssertionError
================================================================================== 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
FAILED tests/test_builder.py::test_ignore_literals - AssertionError: assert '../../../../../tmp/pytest-of-tkloczko/pytest-66/test_ignore_literals0/src/contents.rst:3: (Welcome) Welcome to Spell...../../../../../tmp/pytest-of-tkloczko/py...
FAILED tests/test_builder.py::test_legacy_directive - AssertionError: assert '../../../../../tmp/pytest-of-tkloczko/pytest-66/test_legacy_directive0/src/contents.rst:3: (The) The Module\n../../....e Module\n../../../../../tmp/pytest-of-t...
FAILED tests/test_builder.py::test_domain_directive - AssertionError: assert '../../../../../tmp/pytest-of-tkloczko/pytest-66/test_domain_directive0/src/contents.rst:3: (The) The Module\n../../....e Module\n../../../../../tmp/pytest-of-t...
FAILED tests/test_builder.py::test_domain_role - AssertionError: assert '../../../../../tmp/pytest-of-tkloczko/pytest-66/test_domain_role0/src/contents.rst:3: (The) The Module\n../../../../...ule) The Module\n../../../../../tmp/pyt...
FAILED tests/test_builder.py::test_domain_role_multiple_words - AssertionError: assert '../../../../../tmp/pytest-of-tkloczko/pytest-66/test_domain_role_multiple_word0/src/contents.rst:3: (The) The Module..../../../../tmp/pytest-of-tkloczko/pytest...
FAILED tests/test_builder.py::test_domain_ignore - AssertionError: assert '../../../../../tmp/pytest-of-tkloczko/pytest-66/test_domain_ignore0/src/contents.rst:3: (The) The Module\n../../../....e) The Module\n../../../../../tmp/pytes...
FAILED tests/test_builder.py::test_domain_ignore_multiple_words - AssertionError: assert 12 == 2
FAILED tests/test_checker.py::test_errors_only - AssertionError: assert 'This' == 'txt'
FAILED tests/test_checker.py::test_with_suggestions - AssertionError: Not suggesting
FAILED tests/test_checker.py::test_with_wordlist - AssertionError: Did not use personal word list file
FAILED tests/test_checker.py::test_with_context_line - AssertionError: assert 'Line' == 'txt'
========================================================================= 11 failed, 28 passed, 28 skipped in 3.79s ========================================================================= |
I'm not sure what you're doing there with the python path. It's possible you don't have enough entries for the interpreter to find everything. If you look at what the |
That is only entry added on top of default content of the
None of the test suites should rely on such special procedures like copy something to special directory. Did you try to reproduce this issue? 🤔 |
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 modulescut off from access to the public network
(pytest is executed with-m "not network"
)Here is pytest output:
Here is list of installed modules in build env
The text was updated successfully, but these errors were encountered: