Skip to content

Failing tests from test_order #289

@santiagorr

Description

@santiagorr

Hello there,

A recent upload of mkdocs-include-markdown-plugin (7.2.1) to debian has yield to a Fails To Build From Source bug: https://bugs.debian.org/1128361, because of test found in test_order.py:

--------------------------------------------------------------------------------
[...]
============================= test session starts ==============================
platform linux -- Python 3.14.3, pytest-9.0.2, pluggy-1.6.0
rootdir: /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14_mkdocs-include-markdown-plugin/build
configfile: pyproject.toml
plugins: typeguard-4.4.4
collected 340 items / 88 deselected / 252 selected

tests/test_integration/test_cache_integration.py ..                      [  0%]
tests/test_integration/test_order_setting.py ..                          [  1%]
tests/test_unit/test_arguments.py ...................................... [ 16%]
........................................                                 [ 32%]
tests/test_unit/test_cache.py .......                                    [ 35%]
tests/test_unit/test_config.py ..................                        [ 42%]
tests/test_unit/test_encoding.py ......                                  [ 44%]
tests/test_unit/test_exclude.py ............                             [ 49%]
tests/test_unit/test_glob_include.py ..........                          [ 53%]
tests/test_unit/test_logging.py ....                                     [ 55%]
tests/test_unit/test_nested_includes.py ..........                       [ 59%]
tests/test_unit/test_order.py ........................................FF [ 75%]
..............FFssss....                                                 [ 85%]
tests/test_unit/test_process.py .....................................    [100%]

=================================== FAILURES ===================================
______________ test_natural_order_by_extension[directive=include] ______________

directive = 'include', page = <function page.<locals>._page at 0x7f943402ddd0>
tmp_path = PosixPath('/tmp/pytest-of-sbuild/pytest-0/test_natural_order_by_extensio0')
plugin = <mkdocs_include_markdown_plugin.plugin.IncludeMarkdownPlugin object at 0x7f943420a430>

    @parametrize_directives
    def test_natural_order_by_extension(directive, page, tmp_path, plugin):
        f1 = tmp_path / 'file2.md'
        f1.write_text('file2.md\n')
        f2 = tmp_path / 'file10.txt'
        f2.write_text('file10.txt\n')
        f3 = tmp_path / 'file1.md'
        f3.write_text('file1.md\n')
    
>       assert on_page_markdown(
            f'''{{%
    {directive} "*"
    order='natural-extension'
    %}}''',
            page(tmp_path / 'includer.md'),
            tmp_path,
            plugin,
        ) == 'file1.md\nfile2.md\nfile10.txt\n'
E       AssertionError: assert 'file2.md\nfi...nfile10.txt\n' == 'file1.md\nfi...nfile10.txt\n'
E         
E         + file2.md
E           file1.md
E         - file2.md
E           file10.txt

tests/test_unit/test_order.py:379: AssertionError
_________ test_natural_order_by_extension[directive=include-markdown] __________

directive = 'include-markdown'
page = <function page.<locals>._page at 0x7f943402e400>
tmp_path = PosixPath('/tmp/pytest-of-sbuild/pytest-0/test_natural_order_by_extensio1')
plugin = <mkdocs_include_markdown_plugin.plugin.IncludeMarkdownPlugin object at 0x7f94340415c0>

    @parametrize_directives
    def test_natural_order_by_extension(directive, page, tmp_path, plugin):
        f1 = tmp_path / 'file2.md'
        f1.write_text('file2.md\n')
        f2 = tmp_path / 'file10.txt'
        f2.write_text('file10.txt\n')
        f3 = tmp_path / 'file1.md'
        f3.write_text('file1.md\n')
    
>       assert on_page_markdown(
            f'''{{%
    {directive} "*"
    order='natural-extension'
    %}}''',
            page(tmp_path / 'includer.md'),
            tmp_path,
            plugin,
        ) == 'file1.md\nfile2.md\nfile10.txt\n'
E       AssertionError: assert 'file2.md\nfi...nfile10.txt\n' == 'file1.md\nfi...nfile10.txt\n'
E         
E         + file2.md
E           file1.md
E         - file2.md
E           file10.txt

tests/test_unit/test_order.py:379: AssertionError
__________ test_natural_order_by_extension_reverse[directive=include] __________

directive = 'include', page = <function page.<locals>._page at 0x7f9434070a90>
tmp_path = PosixPath('/tmp/pytest-of-sbuild/pytest-0/test_natural_order_by_extensio2')
plugin = <mkdocs_include_markdown_plugin.plugin.IncludeMarkdownPlugin object at 0x7f9434041710>

    @parametrize_directives
    def test_natural_order_by_extension_reverse(directive, page, tmp_path, plugin):
        f1 = tmp_path / 'file2.md'
        f1.write_text('file2.md\n')
        f2 = tmp_path / 'file10.txt'
        f2.write_text('file10.txt\n')
        f3 = tmp_path / 'file1.md'
        f3.write_text('file1.md\n')
    
>       assert on_page_markdown(
            f'''{{%
    {directive} "*"
    order='-natural-extension'
    %}}''',
            page(tmp_path / 'includer.md'),
            tmp_path,
            plugin,
        ) == 'file10.txt\nfile1.md\nfile2.md\n'
E       AssertionError: assert 'file10.txt\n...d\nfile1.md\n' == 'file10.txt\n...d\nfile2.md\n'
E         
E           file10.txt
E         + file2.md
E           file1.md
E         - file2.md

tests/test_unit/test_order.py:519: AssertionError
_____ test_natural_order_by_extension_reverse[directive=include-markdown] ______

directive = 'include-markdown'
page = <function page.<locals>._page at 0x7f94340710c0>
tmp_path = PosixPath('/tmp/pytest-of-sbuild/pytest-0/test_natural_order_by_extensio3')
plugin = <mkdocs_include_markdown_plugin.plugin.IncludeMarkdownPlugin object at 0x7f9434042d60>

    @parametrize_directives
    def test_natural_order_by_extension_reverse(directive, page, tmp_path, plugin):
        f1 = tmp_path / 'file2.md'
        f1.write_text('file2.md\n')
        f2 = tmp_path / 'file10.txt'
        f2.write_text('file10.txt\n')
        f3 = tmp_path / 'file1.md'
        f3.write_text('file1.md\n')
    
>       assert on_page_markdown(
            f'''{{%
    {directive} "*"
    order='-natural-extension'
    %}}''',
            page(tmp_path / 'includer.md'),
            tmp_path,
            plugin,
        ) == 'file10.txt\nfile1.md\nfile2.md\n'
E       AssertionError: assert 'file10.txt\n...d\nfile1.md\n' == 'file10.txt\n...d\nfile2.md\n'
E         
E           file10.txt
E         + file2.md
E           file1.md
E         - file2.md

tests/test_unit/test_order.py:519: AssertionError
=========================== short test summary info ============================
FAILED tests/test_unit/test_order.py::test_natural_order_by_extension[directive=include]
FAILED tests/test_unit/test_order.py::test_natural_order_by_extension[directive=include-markdown]
FAILED tests/test_unit/test_order.py::test_natural_order_by_extension_reverse[directive=include]
FAILED tests/test_unit/test_order.py::test_natural_order_by_extension_reverse[directive=include-markdown]
=========== 4 failed, 244 passed, 4 skipped, 88 deselected in 0.44s ============
E: pybuild pybuild:483: test: plugin pyproject failed with: exit code=1: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14_mkdocs-include-markdown-plugin/build; python3.14 -m pytest -k 'not test_page_included_by_url_is_cached and not test_examples_subprocess and not test_examples_api and not test_include and not test_read_url_cached_content'
I: pybuild pybuild:388: cp -a examples/ /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_mkdocs-include-markdown-plugin/build
I: pybuild base:384: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_mkdocs-include-markdown-plugin/build; python3.13 -m pytest -k 'not test_page_included_by_url_is_cached and not test_examples_subprocess and not test_examples_api and not test_include and not test_read_url_cached_content'
============================= test session starts ==============================
platform linux -- Python 3.13.12, pytest-9.0.2, pluggy-1.6.0
rootdir: /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_mkdocs-include-markdown-plugin/build
configfile: pyproject.toml
plugins: typeguard-4.4.4
collected 340 items / 88 deselected / 252 selected

tests/test_integration/test_cache_integration.py ..                      [  0%]
tests/test_integration/test_order_setting.py ..                          [  1%]
tests/test_unit/test_arguments.py ...................................... [ 16%]
........................................                                 [ 32%]
tests/test_unit/test_cache.py .......                                    [ 35%]
tests/test_unit/test_config.py ..................                        [ 42%]
tests/test_unit/test_encoding.py ......                                  [ 44%]
tests/test_unit/test_exclude.py ............                             [ 49%]
tests/test_unit/test_glob_include.py ..........                          [ 53%]
tests/test_unit/test_logging.py ....                                     [ 55%]
tests/test_unit/test_nested_includes.py ..........                       [ 59%]
tests/test_unit/test_order.py ........................................FF [ 75%]
..............FFssss....                                                 [ 85%]
tests/test_unit/test_process.py .....................................    [100%]

=================================== FAILURES ===================================
______________ test_natural_order_by_extension[directive=include] ______________

directive = 'include', page = <function page.<locals>._page at 0x7f6d2a8d2480>
tmp_path = PosixPath('/tmp/pytest-of-sbuild/pytest-1/test_natural_order_by_extensio0')
plugin = <mkdocs_include_markdown_plugin.plugin.IncludeMarkdownPlugin object at 0x7f6d2aac7350>

    @parametrize_directives
    def test_natural_order_by_extension(directive, page, tmp_path, plugin):
        f1 = tmp_path / 'file2.md'
        f1.write_text('file2.md\n')
        f2 = tmp_path / 'file10.txt'
        f2.write_text('file10.txt\n')
        f3 = tmp_path / 'file1.md'
        f3.write_text('file1.md\n')
    
>       assert on_page_markdown(
            f'''{{%
    {directive} "*"
    order='natural-extension'
    %}}''',
            page(tmp_path / 'includer.md'),
            tmp_path,
            plugin,
        ) == 'file1.md\nfile2.md\nfile10.txt\n'
E       AssertionError: assert 'file2.md\nfi...nfile10.txt\n' == 'file1.md\nfi...nfile10.txt\n'
E         
E         + file2.md
E           file1.md
E         - file2.md
E           file10.txt

tests/test_unit/test_order.py:379: AssertionError
_________ test_natural_order_by_extension[directive=include-markdown] __________

directive = 'include-markdown'
page = <function page.<locals>._page at 0x7f6d2a8d2520>
tmp_path = PosixPath('/tmp/pytest-of-sbuild/pytest-1/test_natural_order_by_extensio1')
plugin = <mkdocs_include_markdown_plugin.plugin.IncludeMarkdownPlugin object at 0x7f6d2aac64b0>

    @parametrize_directives
    def test_natural_order_by_extension(directive, page, tmp_path, plugin):
        f1 = tmp_path / 'file2.md'
        f1.write_text('file2.md\n')
        f2 = tmp_path / 'file10.txt'
        f2.write_text('file10.txt\n')
        f3 = tmp_path / 'file1.md'
        f3.write_text('file1.md\n')
    
>       assert on_page_markdown(
            f'''{{%
    {directive} "*"
    order='natural-extension'
    %}}''',
            page(tmp_path / 'includer.md'),
            tmp_path,
            plugin,
        ) == 'file1.md\nfile2.md\nfile10.txt\n'
E       AssertionError: assert 'file2.md\nfi...nfile10.txt\n' == 'file1.md\nfi...nfile10.txt\n'
E         
E         + file2.md
E           file1.md
E         - file2.md
E           file10.txt

tests/test_unit/test_order.py:379: AssertionError
__________ test_natural_order_by_extension_reverse[directive=include] __________

directive = 'include', page = <function page.<locals>._page at 0x7f6d2a8d3d80>
tmp_path = PosixPath('/tmp/pytest-of-sbuild/pytest-1/test_natural_order_by_extensio2')
plugin = <mkdocs_include_markdown_plugin.plugin.IncludeMarkdownPlugin object at 0x7f6d2a86d370>

    @parametrize_directives
    def test_natural_order_by_extension_reverse(directive, page, tmp_path, plugin):
        f1 = tmp_path / 'file2.md'
        f1.write_text('file2.md\n')
        f2 = tmp_path / 'file10.txt'
        f2.write_text('file10.txt\n')
        f3 = tmp_path / 'file1.md'
        f3.write_text('file1.md\n')
    
>       assert on_page_markdown(
            f'''{{%
    {directive} "*"
    order='-natural-extension'
    %}}''',
            page(tmp_path / 'includer.md'),
            tmp_path,
            plugin,
        ) == 'file10.txt\nfile1.md\nfile2.md\n'
E       AssertionError: assert 'file10.txt\n...d\nfile1.md\n' == 'file10.txt\n...d\nfile2.md\n'
E         
E           file10.txt
E         + file2.md
E           file1.md
E         - file2.md

tests/test_unit/test_order.py:519: AssertionError
_____ test_natural_order_by_extension_reverse[directive=include-markdown] ______

directive = 'include-markdown'
page = <function page.<locals>._page at 0x7f6d2a8d3e20>
tmp_path = PosixPath('/tmp/pytest-of-sbuild/pytest-1/test_natural_order_by_extensio3')
plugin = <mkdocs_include_markdown_plugin.plugin.IncludeMarkdownPlugin object at 0x7f6d2a86e990>

    @parametrize_directives
    def test_natural_order_by_extension_reverse(directive, page, tmp_path, plugin):
        f1 = tmp_path / 'file2.md'
        f1.write_text('file2.md\n')
        f2 = tmp_path / 'file10.txt'
        f2.write_text('file10.txt\n')
        f3 = tmp_path / 'file1.md'
        f3.write_text('file1.md\n')
    
>       assert on_page_markdown(
            f'''{{%
    {directive} "*"
    order='-natural-extension'
    %}}''',
            page(tmp_path / 'includer.md'),
            tmp_path,
            plugin,
        ) == 'file10.txt\nfile1.md\nfile2.md\n'
E       AssertionError: assert 'file10.txt\n...d\nfile1.md\n' == 'file10.txt\n...d\nfile2.md\n'
E         
E           file10.txt
E         + file2.md
E           file1.md
E         - file2.md

tests/test_unit/test_order.py:519: AssertionError
=========================== short test summary info ============================
FAILED tests/test_unit/test_order.py::test_natural_order_by_extension[directive=include]
FAILED tests/test_unit/test_order.py::test_natural_order_by_extension[directive=include-markdown]
FAILED tests/test_unit/test_order.py::test_natural_order_by_extension_reverse[directive=include]
FAILED tests/test_unit/test_order.py::test_natural_order_by_extension_reverse[directive=include-markdown]
=========== 4 failed, 244 passed, 4 skipped, 88 deselected in 0.61s ============
E: pybuild pybuild:483: test: plugin pyproject failed with: exit code=1: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_mkdocs-include-markdown-plugin/build; python3.13 -m pytest -k 'not test_page_included_by_url_is_cached and not test_examples_subprocess and not test_examples_api and not test_include and not test_read_url_cached_content'
dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p "3.14 3.13" returned exit code 13
make: *** [debian/rules:12: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess failed with exit status 2
--------------------------------------------------------------------------------

These errors have been reproduced in other tooling, such as: https://debusine.debian.net/debian/developers/artifact/3325197/

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions