diff options
author | Andrew Stubbs <[email protected]> | 2025-01-24 15:34:12 +0000 |
---|---|---|
committer | Leo Famulari <[email protected]> | 2025-01-30 00:42:37 -0500 |
commit | a20df73c7d69356c0800dcc082c1a71e987acf13 (patch) | |
tree | 5dbbbd56311ba83eaa2021d45b735a9893ce703f /gnu | |
parent | 7991121aa11728c29a307a0b83719d756d7be3d1 (diff) |
gnu: thefuck: Remove broken tests.
These tests were reported broken upstream, but nothing has been done
about it. See the upstream bug report for more information:
https://github.com/nvbn/thefuck/issues/1438
Fixes <https://issues.guix.gnu.org/75464>.
* gnu/packages/admin.scm (thefuck)[source]: Add patch.
* gnu/packages/patches/thefuck-remove-broken-tests.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
Change-Id: Ib6bbda92b29cd2a26b9c08d79e309e2c78602b71
Signed-off-by: Leo Famulari <[email protected]>
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/local.mk | 1 | ||||
-rw-r--r-- | gnu/packages/admin.scm | 3 | ||||
-rw-r--r-- | gnu/packages/patches/thefuck-remove-broken-tests.patch | 53 |
3 files changed, 56 insertions, 1 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index 328f6f2a27..e8c807cf63 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2290,6 +2290,7 @@ dist_patch_DATA = \ %D%/packages/patches/texi2html-i18n.patch \ %D%/packages/patches/texmacs-wayland-hidpi.patch \ %D%/packages/patches/thefuck-test-environ.patch \ + %D%/packages/patches/thefuck-remove-broken-tests.patch \ %D%/packages/patches/tidy-CVE-2015-5522+5523.patch \ %D%/packages/patches/timewarrior-time-sensitive-tests.patch \ %D%/packages/patches/tinyxml-use-stl.patch \ diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index fd5d67ec50..18f4d55c70 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -3856,7 +3856,8 @@ plug-in architecture to allow monitoring other system metrics.") (file-name (git-file-name name version)) (sha256 (base32 "18ipa1bm6q1n5drbi8i65726hhqhl1g41390lfqrc11hkbvv443d")) - (patches (search-patches "thefuck-test-environ.patch")))) + (patches (search-patches "thefuck-test-environ.patch" + "thefuck-remove-broken-tests.patch")))) (build-system python-build-system) (arguments '(#:phases diff --git a/gnu/packages/patches/thefuck-remove-broken-tests.patch b/gnu/packages/patches/thefuck-remove-broken-tests.patch new file mode 100644 index 0000000000..4a97c86cc5 --- /dev/null +++ b/gnu/packages/patches/thefuck-remove-broken-tests.patch @@ -0,0 +1,53 @@ +Remove tests that fail with Pytest 8: + +https://github.com/nvbn/thefuck/issues/1438 +https://issues.guix.gnu.org/75464 + +diff -ruN a/tests/test_utils.py b/tests/test_utils.py +--- a/tests/test_utils.py 1970-01-01 00:00:01.000000000 +0000 ++++ b/tests/test_utils.py 2025-01-22 12:21:07.045281481 +0000 +@@ -233,44 +233,3 @@ + assert fn() == 'test' + assert shelve == {key: {'etag': '0', 'value': 'test'}} + +- +-class TestGetValidHistoryWithoutCurrent(object): +- @pytest.fixture(autouse=True) +- def fail_on_warning(self): +- warnings.simplefilter('error') +- yield +- warnings.resetwarnings() +- +- @pytest.fixture(autouse=True) +- def history(self, mocker): +- mock = mocker.patch('thefuck.shells.shell.get_history') +- # Passing as an argument causes `UnicodeDecodeError` +- # with newer py.test and python 2.7 +- mock.return_value = ['le cat', 'fuck', 'ls cat', +- 'diff x', 'nocommand x', u'café ô'] +- return mock +- +- @pytest.fixture(autouse=True) +- def alias(self, mocker): +- return mocker.patch('thefuck.utils.get_alias', +- return_value='fuck') +- +- @pytest.fixture(autouse=True) +- def bins(self, mocker): +- callables = list() +- for name in ['diff', 'ls', 'café']: +- bin_mock = mocker.Mock(name=name) +- bin_mock.configure_mock(name=name, is_dir=lambda: False) +- callables.append(bin_mock) +- path_mock = mocker.Mock(iterdir=mocker.Mock(return_value=callables)) +- return mocker.patch('thefuck.utils.Path', return_value=path_mock) +- +- @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 |