diff options
author | Yixun Lan <dlan@gentoo.org> | 2021-09-30 09:27:33 +0800 |
---|---|---|
committer | Yixun Lan <dlan@gentoo.org> | 2021-09-30 09:27:33 +0800 |
commit | 2c092ede25d5a926be067fbf53f5b3c17143f965 (patch) | |
tree | 3cf0f37905e44a8102308f17f6267004572a8faa /dev-vcs/git-pw | |
parent | media-libs/libjpeg-turbo: Stabilize 2.1.1-r2 arm64, #812851 (diff) | |
download | gentoo-2c092ede25d5a926be067fbf53f5b3c17143f965.tar.gz gentoo-2c092ede25d5a926be067fbf53f5b3c17143f965.tar.bz2 gentoo-2c092ede25d5a926be067fbf53f5b3c17143f965.zip |
dev-vcs/git-pw: fix tests error
Thanks Matt Smith for contribution
Closes: https://bugs.gentoo.org/815031
Package-Manager: Portage-3.0.23, Repoman-3.0.3
Signed-off-by: Yixun Lan <dlan@gentoo.org>
Diffstat (limited to 'dev-vcs/git-pw')
-rw-r--r-- | dev-vcs/git-pw/files/git-pw-2.1.1-test.patch | 28 | ||||
-rw-r--r-- | dev-vcs/git-pw/git-pw-2.1.1.ebuild | 2 |
2 files changed, 30 insertions, 0 deletions
diff --git a/dev-vcs/git-pw/files/git-pw-2.1.1-test.patch b/dev-vcs/git-pw/files/git-pw-2.1.1-test.patch new file mode 100644 index 000000000000..00df55f872d1 --- /dev/null +++ b/dev-vcs/git-pw/files/git-pw-2.1.1-test.patch @@ -0,0 +1,28 @@ +From 08152c86d02c36c425047fa9220d6d5ac3fcda01 Mon Sep 17 00:00:00 2001 +From: Matt Smith <matt@offtopica.uk> +Date: Sun, 26 Sep 2021 19:55:40 +0100 +Subject: [PATCH] tests: Unset PAGER env when testing fallback + +Prior to this commit, the test test_echo_via_pager_env_default will +fail when $PAGER is set to /usr/bin/less (or anything other than +"less"). Use unittest.mock to unset the environment variable during +the test. +--- + tests/test_utils.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tests/test_utils.py b/tests/test_utils.py +index cf75a55..a0974f1 100644 +--- a/tests/test_utils.py ++++ b/tests/test_utils.py +@@ -75,6 +75,7 @@ def test_echo_via_pager_env_PAGER(mock_inner, mock_tabulate, mock_config): + @mock.patch.object(utils, 'git_config', return_value=None) + @mock.patch.object(utils, '_tabulate') + @mock.patch.object(utils, '_echo_via_pager') ++@mock.patch.dict(os.environ, {'PAGER': ''}) + def test_echo_via_pager_env_default(mock_inner, mock_tabulate, mock_config): + utils.echo_via_pager('test', ('foo',), None) + +-- +2.33.0 + diff --git a/dev-vcs/git-pw/git-pw-2.1.1.ebuild b/dev-vcs/git-pw/git-pw-2.1.1.ebuild index a27a91f9a2c5..dd63e27b733c 100644 --- a/dev-vcs/git-pw/git-pw-2.1.1.ebuild +++ b/dev-vcs/git-pw/git-pw-2.1.1.ebuild @@ -21,6 +21,8 @@ LICENSE="MIT" SLOT="0" IUSE="" +PATCHES=( "${FILESDIR}/${P}-test.patch" ) + RDEPEND=" >=dev-python/arrow-0.10[${PYTHON_USEDEP}] <dev-python/click-8.0[${PYTHON_USEDEP}] |