Skip to content

Failing tests test_wrap_multiword_non_wide* in current Pythons #389

@musicinmybrain

Description

@musicinmybrain

In Python 3.13.11, 3.14.2, and 3.15.0a2 (but not 3.13.9 or 3.14.0), tests test_wrap_multiword_non_wide and test_wrap_multiword_non_wide_with_hypens fail. This is true for the latest PyPI release 0.9.0 and for the current master, 74885be.

$ python3.14 --version
Python 3.14.2
$ git clone https://github.com/musicinmybrain/python-tabulate.git
$ cd python-tabulate
$ tox -e py314
[…]
========================================================================================= FAILURES =========================================================================================
_______________________________________________________________________________ test_wrap_multiword_non_wide _______________________________________________________________________________

    def test_wrap_multiword_non_wide():
        """TextWrapper: non-wide character regression tests"""
        data = "this is a test string for regression splitting"
        for width in range(1, len(data)):
            orig = OTW(width=width)
            cust = CTW(width=width)

>           assert orig.wrap(data) == cust.wrap(
                data
            ), "Failure on non-wide char multiword regression check for width " + str(width)
E           AssertionError: Failure on non-wide char multiword regression check for width 2
E           assert ['th', 'is', ...e', 'st', ...] == ['th', 'is', ...e', 'st', ...]
E             
E             At index 3 diff: 'a' != 'a '
E             
E             Full diff:
E               [
E                   'th',
E                   'is',...
E             
E             ...Full output truncated (24 lines hidden), use '-vv' to show

test/test_textwrapper.py:18: AssertionError
_________________________________________________________________________ test_wrap_multiword_non_wide_with_hypens _________________________________________________________________________

    def test_wrap_multiword_non_wide_with_hypens():
        """TextWrapper: non-wide character regression tests that contain hyphens"""
        data = "how should-we-split-this non-sense string that-has-lots-of-hypens"
        for width in range(1, len(data)):
            orig = OTW(width=width)
            cust = CTW(width=width)

>           assert orig.wrap(data) == cust.wrap(
                data
            ), "Failure on non-wide char hyphen regression check for width " + str(width)
E           AssertionError: Failure on non-wide char hyphen regression check for width 2
E           assert ['ho', 'w', '...d', '-w', ...] == ['ho', 'w ', ...d', '-w', ...]
E             
E             At index 1 diff: 'w' != 'w '
E             
E             Full diff:
E               [
E                   'ho',
E             -     'w ',...
E             
E             ...Full output truncated (35 lines hidden), use '-vv' to show

test/test_textwrapper.py:30: AssertionError
================================================================================= short test summary info ==================================================================================
FAILED test/test_textwrapper.py::test_wrap_multiword_non_wide - AssertionError: Failure on non-wide char multiword regression check for width 2
FAILED test/test_textwrapper.py::test_wrap_multiword_non_wide_with_hypens - AssertionError: Failure on non-wide char hyphen regression check for width 2
======================================================================== 2 failed, 289 passed, 41 skipped in 0.63s =========================================================================
py314: exit 1 (0.78 seconds) /home/ben/src/forks/python-tabulate> pytest -v --doctest-modules --ignore benchmark pid=1934098
  py314: FAIL code 1 (2.68=setup[1.90]+cmd[0.78] seconds)
  evaluation failed :( (2.72 seconds)

Since this issue is related to non-wide characters, #387 is not a fix for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions