Bug 2275412 - thefuck fails to build with pytest 8: AssertionError: assert ['ls cat', 'diff x'] == ['ls cat', 'diff x', 'café ô']
Summary: thefuck fails to build with pytest 8: AssertionError: assert ['ls cat', 'diff...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: thefuck
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Arthur Bols
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2256331
TreeView+ depends on / blocked
 
Reported: 2024-04-17 06:37 UTC by Tomáš Hrnčiar
Modified: 2024-11-05 17:32 UTC (History)
5 users (show)

Fixed In Version: thefuck-3.32-14.fc42
Clone Of:
Environment:
Last Closed: 2024-11-05 17:32:38 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github nvbn thefuck issues 1438 0 None open Compatibility with pytest 8 2024-04-17 06:37:50 UTC

Description Tomáš Hrnčiar 2024-04-17 06:37:51 UTC
thefuck fails to build with pytest 8.

=================================== FAILURES ===================================
_ TestGetValidHistoryWithoutCurrent.test_get_valid_history_without_current[le cat-result0] _

self = <tests.test_utils.TestGetValidHistoryWithoutCurrent object at 0x7ff8d6cf24e0>
script = 'le cat', result = ['ls cat', 'diff x', 'café ô']

    @pytest.mark.parametrize('script, result', [
        ('le cat', ['ls cat', 'diff x', u'café ô']),
        ('diff x', ['ls cat', u'café ô']),
        ('fuck', ['ls cat', 'diff x', u'café ô']),
        (u'cafe ô', ['ls cat', 'diff x', u'café ô']),
    ])
    def test_get_valid_history_without_current(self, script, result):
        command = Command(script, '')
>       assert get_valid_history_without_current(command) == result
E       AssertionError: assert ['ls cat', 'diff x'] == ['ls cat', 'diff x', 'café ô']
E         
E         Right contains one more item: 'café ô'
E         
E         Full diff:
E           [
E               'ls cat',
E               'diff x',
E         -     'café ô',
E           ]

/builddir/build/BUILD/thefuck-3.32/tests/test_utils.py:276: AssertionError
_ TestGetValidHistoryWithoutCurrent.test_get_valid_history_without_current[diff x-result1] _

self = <tests.test_utils.TestGetValidHistoryWithoutCurrent object at 0x7ff8d6cf2f00>
script = 'diff x', result = ['ls cat', 'café ô']

    @pytest.mark.parametrize('script, result', [
        ('le cat', ['ls cat', 'diff x', u'café ô']),
        ('diff x', ['ls cat', u'café ô']),
        ('fuck', ['ls cat', 'diff x', u'café ô']),
        (u'cafe ô', ['ls cat', 'diff x', u'café ô']),
    ])
    def test_get_valid_history_without_current(self, script, result):
        command = Command(script, '')
>       assert get_valid_history_without_current(command) == result
E       AssertionError: assert ['ls cat'] == ['ls cat', 'café ô']
E         
E         Right contains one more item: 'café ô'
E         
E         Full diff:
E           [
E               'ls cat',
E         -     'café ô',
E           ]

/builddir/build/BUILD/thefuck-3.32/tests/test_utils.py:276: AssertionError
_ TestGetValidHistoryWithoutCurrent.test_get_valid_history_without_current[fuck-result2] _

self = <tests.test_utils.TestGetValidHistoryWithoutCurrent object at 0x7ff8d6cf3260>
script = 'fuck', result = ['ls cat', 'diff x', 'café ô']

    @pytest.mark.parametrize('script, result', [
        ('le cat', ['ls cat', 'diff x', u'café ô']),
        ('diff x', ['ls cat', u'café ô']),
        ('fuck', ['ls cat', 'diff x', u'café ô']),
        (u'cafe ô', ['ls cat', 'diff x', u'café ô']),
    ])
    def test_get_valid_history_without_current(self, script, result):
        command = Command(script, '')
>       assert get_valid_history_without_current(command) == result
E       AssertionError: assert ['ls cat', 'diff x'] == ['ls cat', 'diff x', 'café ô']
E         
E         Right contains one more item: 'café ô'
E         
E         Full diff:
E           [
E               'ls cat',
E               'diff x',
E         -     'café ô',
E           ]

/builddir/build/BUILD/thefuck-3.32/tests/test_utils.py:276: AssertionError
_ TestGetValidHistoryWithoutCurrent.test_get_valid_history_without_current[cafe \xf4-result3] _

self = <tests.test_utils.TestGetValidHistoryWithoutCurrent object at 0x7ff8d6cf0050>
script = 'cafe ô', result = ['ls cat', 'diff x', 'café ô']

    @pytest.mark.parametrize('script, result', [
        ('le cat', ['ls cat', 'diff x', u'café ô']),
        ('diff x', ['ls cat', u'café ô']),
        ('fuck', ['ls cat', 'diff x', u'café ô']),
        (u'cafe ô', ['ls cat', 'diff x', u'café ô']),
    ])
    def test_get_valid_history_without_current(self, script, result):
        command = Command(script, '')
>       assert get_valid_history_without_current(command) == result
E       AssertionError: assert ['ls cat', 'diff x'] == ['ls cat', 'diff x', 'café ô']
E         
E         Right contains one more item: 'café ô'
E         
E         Full diff:
E           [
E               'ls cat',
E               'diff x',
E         -     'café ô',
E           ]

/builddir/build/BUILD/thefuck-3.32/tests/test_utils.py:276: AssertionError
=============================== warnings summary ===============================
../../../../usr/lib/python3.12/site-packages/zombie_imp/__init__.py:1
  /usr/lib/python3.12/site-packages/zombie_imp/__init__.py:1: DeprecationWarning: the imp module was removed in favour of importlib. Someone brought it back, but it's not a good idea to use it.
    from .imp_3_11 import *

../../../../usr/lib/python3.12/site-packages/_pytest/fixtures.py:1314
  /usr/lib/python3.12/site-packages/_pytest/fixtures.py:1314: PytestRemovedIn9Warning: Marks applied to fixtures have no effect
  See docs: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function
    return fixture_marker(fixture_function)

tests/rules/test_dirty_untar.py: 270 warnings
  /usr/lib64/python3.12/tarfile.py:2221: DeprecationWarning: Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior.
    warnings.warn(

tests/test_conf.py::test_get_user_dir_path[True-~/.config-~/.thefuck]
  /builddir/build/BUILD/thefuck-3.32/thefuck/conf.py:52: UserWarning: Config path /builddir/.thefuck is deprecated. Please move to /builddir/.config/thefuck
    warn(u'Config path {} is deprecated. Please move to {}'.format(

tests/test_conf.py::test_get_user_dir_path[True-/user/test/config/-~/.thefuck]
  /builddir/build/BUILD/thefuck-3.32/thefuck/conf.py:52: UserWarning: Config path /builddir/.thefuck is deprecated. Please move to /user/test/config/thefuck
    warn(u'Config path {} is deprecated. Please move to {}'.format(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_utils.py::TestGetValidHistoryWithoutCurrent::test_get_valid_history_without_current[le cat-result0]
FAILED tests/test_utils.py::TestGetValidHistoryWithoutCurrent::test_get_valid_history_without_current[diff x-result1]
FAILED tests/test_utils.py::TestGetValidHistoryWithoutCurrent::test_get_valid_history_without_current[fuck-result2]
FAILED tests/test_utils.py::TestGetValidHistoryWithoutCurrent::test_get_valid_history_without_current[cafe \xf4-result3]
=========== 4 failed, 1793 passed, 62 skipped, 274 warnings in 2.99s ===========

https://docs.pytest.org/en/stable/changelog.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/thrnciar/pytest/fedora-rawhide-x86_64/07249216-thefuck/

For all our attempts to build thefuck with pytest 8, see:
https://copr.fedorainfracloud.org/coprs/thrnciar/pytest/package/thefuck/

Let us know here if you have any questions.

Pytest 8 is planned to be included in Fedora 41. And this bugzilla is a
heads up before we merge new pytest into rawhide. For more info see a Fedora Change
proposal https://fedoraproject.org/wiki/Changes/Pytest_8

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Arthur Bols 2024-04-22 09:55:00 UTC
Thanks for pointing out this problem. Would disabling the tests fix this? I'm extremely busy, which won't change until July at the earliest, and since upstream really doesn't seem to care (there are unanswered issues and a PR about imp), I'd rather spend my limited time on other packages.

Someone mentioned the master branch fixes the `imp` issues, not sure if this will fix the pytest issues. Anyway, I won't have time to investigate this until July. If there are simple workaround/fixes, please let me know. I'm also happy to look at PR's.

Comment 2 Fedora Update System 2024-11-05 17:28:32 UTC
FEDORA-2024-299a024378 (thefuck-3.32-14.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-299a024378

Comment 3 Fedora Update System 2024-11-05 17:32:38 UTC
FEDORA-2024-299a024378 (thefuck-3.32-14.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.