facelessuser / pymdown-extensions

Extensions for Python Markdown
https://facelessuser.github.io/pymdown-extensions/
Other
931 stars 248 forks source link

10.8.1: pytest fails in 4 units #2378

Closed kloczek closed 2 months ago

kloczek commented 2 months ago

Description

Looks like pytest fails in 4 units

Here is pytest output: ```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pymdown-extensions-10.8.1-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pymdown-extensions-10.8.1-2.fc37.x86_64/usr/lib/python3.10/site-packages + /usr/bin/pytest -ra -m 'not network' ==================================================================================== test session starts ==================================================================================== platform linux -- Python 3.10.14, pytest-8.1.1, pluggy-1.4.0 rootdir: /home/tkloczko/rpmbuild/BUILD/pymdown-extensions-10.8.1 configfile: pyproject.toml plugins: datadir-1.5.0, sphinx_pytest-0.2.0, regressions-2.5.0, pytest_param_files-0.6.0, timeout-2.3.1, mock-3.14.0 collected 532 items tests/test_extensions/test_arithmatex.py .......... [ 1%] tests/test_extensions/test_b64.py ..... [ 2%] tests/test_extensions/test_betterem.py ...... [ 3%] tests/test_extensions/test_blocks/test_admonitions.py ............ [ 6%] tests/test_extensions/test_blocks/test_definition.py ..... [ 7%] tests/test_extensions/test_blocks/test_details.py ........... [ 9%] tests/test_extensions/test_blocks/test_general_blocks.py .................................... [ 15%] tests/test_extensions/test_blocks/test_html.py ................ [ 18%] tests/test_extensions/test_blocks/test_legacy_tab.py ........ [ 20%] tests/test_extensions/test_blocks/test_tab.py ........... [ 22%] tests/test_extensions/test_details.py ............... [ 25%] tests/test_extensions/test_emoji.py .. [ 25%] tests/test_extensions/test_escapeall.py .... [ 26%] tests/test_extensions/test_highlight.py FF............................ [ 32%] tests/test_extensions/test_inlinehilite.py .......FF............ [ 36%] tests/test_extensions/test_keys.py . [ 36%] tests/test_extensions/test_legacy_slugs.py ...... [ 37%] tests/test_extensions/test_magiclink.py ............................ [ 42%] tests/test_extensions/test_pathconverter.py ............................................. [ 51%] tests/test_extensions/test_saneheaders.py .......... [ 53%] tests/test_extensions/test_slugs.py ........ [ 54%] tests/test_extensions/test_smartsymbols.py ........... [ 56%] tests/test_extensions/test_snippets.py .................................................. [ 65%] tests/test_extensions/test_striphmtl.py . [ 66%] tests/test_extensions/test_superfences.py .......................................................... [ 77%] tests/test_extensions/test_tabbed.py ..................... [ 81%] tests/test_extensions/test_tabbed_alternate.py ..................... [ 84%] tests/test_syntax.py ............................................................... [ 96%] tests/test_targeted.py ............. [ 99%] tests/test_versions.py .... [100%] ========================================================================================= FAILURES ========================================================================================== _______________________________________________________________________________ TestHighlightGuess.test_guess _______________________________________________________________________________ self = def test_guess(self): """Test guessing.""" > self.check_markdown( r''' ``` import test test.test() ``` ''', '''
import test
            test.test()
            
''', True ) tests/test_extensions/test_highlight.py:18: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/util.py:91: in check_markdown self.assertTrue(not diff) E AssertionError: False is not true ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ --- Expected +++ Actual @@ -1,3 +1,3 @@ -
import test
+
import test
 test.test()
 
_________________________________________________________________________ TestHighlightGuessBlock.test_guess_block __________________________________________________________________________ self = def test_guess_block(self): """Test guessing for block.""" > self.check_markdown( r''' ``` import test test.test() ``` ''', '''
import test
            test.test()
            
''', True ) tests/test_extensions/test_highlight.py:47: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/util.py:91: in check_markdown self.assertTrue(not diff) E AssertionError: False is not true ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ --- Expected +++ Actual @@ -1,3 +1,3 @@ -
import test
+
import test
 test.test()
 
____________________________________________________________________________ TestInlineHiliteGuess.test_guessing ____________________________________________________________________________ self = def test_guessing(self): """Ensure guessing can be enabled.""" > self.check_markdown( r'`import module`.', r'

import module.

' ) tests/test_extensions/test_inlinehilite.py:225: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/util.py:91: in check_markdown self.assertTrue(not diff) E AssertionError: False is not true ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ --- Expected +++ Actual @@ -1 +1 @@ -

import module.

+

import module.

_____________________________________________________________________ TestInlineHiliteGuessInline.test_guessing_inline ______________________________________________________________________ self = def test_guessing_inline(self): """Ensure guessing can be enabled for inline only.""" > self.check_markdown( r'`import module`.', r'

import module.

' ) tests/test_extensions/test_inlinehilite.py:252: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/util.py:91: in check_markdown self.assertTrue(not diff) E AssertionError: False is not true ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ --- Expected +++ Actual @@ -1 +1 @@ -

import module.

+

import module.

================================================================================== short test summary info ================================================================================== FAILED tests/test_extensions/test_highlight.py::TestHighlightGuess::test_guess - AssertionError: False is not true FAILED tests/test_extensions/test_highlight.py::TestHighlightGuessBlock::test_guess_block - AssertionError: False is not true FAILED tests/test_extensions/test_inlinehilite.py::TestInlineHiliteGuess::test_guessing - AssertionError: False is not true FAILED tests/test_extensions/test_inlinehilite.py::TestInlineHiliteGuessInline::test_guessing_inline - AssertionError: False is not true =============================================================================== 4 failed, 528 passed in 7.16s =============================================================================== ```
List of installed modules in build env: ```console Package Version ------------------ ----------- build 1.2.1 exceptiongroup 1.1.3 hatchling 1.24.0 importlib_metadata 7.1.0 iniconfig 2.0.0 installer 0.7.0 Markdown 3.6 packaging 24.0 pathspec 0.12.1 pluggy 1.4.0 Pygments 2.18.0 pyproject_hooks 1.0.0 pytest 8.1.1 python-dateutil 2.9.0.post0 PyYAML 6.0.1 tokenize_rt 5.2.0 tomli 2.0.1 trove-classifiers 2024.4.16 wheel 0.43.0 zipp 3.18.1 ```

Please let me know if you need more details or want me to perform some diagnostics.

Minimal Reproduction

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
  • because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
  • install .whl file in </install/prefix> using installer module
  • run pytest with $PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
  • build is performed in env which is cut off from access to the public network (pytest is executed with -m "not network")

Version(s) & System Info

  • Operating System: Linux x86/64
  • Python Version: 3.10.14
  • Package Version: 10.8.1
facelessuser commented 2 months ago

Looks like there may have been a Pygments release in the last couple of days? I tagged a release last week with all passing tests, so this has to be very new. I'm unlikely to tag a new release just because of a new Pygments release changing a lexer's output, but we should update tests on main.

kloczek commented 1 month ago

Just tested f1e2fad8 and with that commit all is clean

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pymdown-extensions-10.8.1-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pymdown-extensions-10.8.1-2.fc37.x86_64/usr/lib/python3.10/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.10.14, pytest-8.2.1, pluggy-1.5.0
rootdir: /home/tkloczko/rpmbuild/BUILD/pymdown-extensions-10.8.1
configfile: pyproject.toml
plugins: flakes-4.0.5
collected 532 items

tests/test_extensions/test_arithmatex.py ..........                                                                                                                                   [  1%]
tests/test_extensions/test_b64.py .....                                                                                                                                               [  2%]
tests/test_extensions/test_betterem.py ......                                                                                                                                         [  3%]
tests/test_extensions/test_blocks/test_admonitions.py ............                                                                                                                    [  6%]
tests/test_extensions/test_blocks/test_definition.py .....                                                                                                                            [  7%]
tests/test_extensions/test_blocks/test_details.py ...........                                                                                                                         [  9%]
tests/test_extensions/test_blocks/test_general_blocks.py ....................................                                                                                         [ 15%]
tests/test_extensions/test_blocks/test_html.py ................                                                                                                                       [ 18%]
tests/test_extensions/test_blocks/test_legacy_tab.py ........                                                                                                                         [ 20%]
tests/test_extensions/test_blocks/test_tab.py ...........                                                                                                                             [ 22%]
tests/test_extensions/test_details.py ...............                                                                                                                                 [ 25%]
tests/test_extensions/test_emoji.py ..                                                                                                                                                [ 25%]
tests/test_extensions/test_escapeall.py ....                                                                                                                                          [ 26%]
tests/test_extensions/test_highlight.py ..............................                                                                                                                [ 32%]
tests/test_extensions/test_inlinehilite.py .....................                                                                                                                      [ 36%]
tests/test_extensions/test_keys.py .                                                                                                                                                  [ 36%]
tests/test_extensions/test_legacy_slugs.py ......                                                                                                                                     [ 37%]
tests/test_extensions/test_magiclink.py ............................                                                                                                                  [ 42%]
tests/test_extensions/test_pathconverter.py .............................................                                                                                             [ 51%]
tests/test_extensions/test_saneheaders.py ..........                                                                                                                                  [ 53%]
tests/test_extensions/test_slugs.py ........                                                                                                                                          [ 54%]
tests/test_extensions/test_smartsymbols.py ...........                                                                                                                                [ 56%]
tests/test_extensions/test_snippets.py ..................................................                                                                                             [ 65%]
tests/test_extensions/test_striphmtl.py .                                                                                                                                             [ 66%]
tests/test_extensions/test_superfences.py ..........................................................                                                                                  [ 77%]
tests/test_extensions/test_tabbed.py .....................                                                                                                                            [ 81%]
tests/test_extensions/test_tabbed_alternate.py .....................                                                                                                                  [ 84%]
tests/test_syntax.py ...............................................................                                                                                                  [ 96%]
tests/test_targeted.py .............                                                                                                                                                  [ 99%]
tests/test_versions.py ....                                                                                                                                                           [100%]

==================================================================================== 532 passed in 5.84s ====================================================================================

Thank you very much 👍 😄