1 |
commit: 2c092ede25d5a926be067fbf53f5b3c17143f965 |
2 |
Author: Yixun Lan <dlan <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Sep 30 01:27:33 2021 +0000 |
4 |
Commit: Yixun Lan <dlan <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 30 01:27:33 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2c092ede |
7 |
|
8 |
dev-vcs/git-pw: fix tests error |
9 |
|
10 |
Thanks Matt Smith for contribution |
11 |
|
12 |
Closes: https://bugs.gentoo.org/815031 |
13 |
Package-Manager: Portage-3.0.23, Repoman-3.0.3 |
14 |
Signed-off-by: Yixun Lan <dlan <AT> gentoo.org> |
15 |
|
16 |
dev-vcs/git-pw/files/git-pw-2.1.1-test.patch | 28 ++++++++++++++++++++++++++++ |
17 |
dev-vcs/git-pw/git-pw-2.1.1.ebuild | 2 ++ |
18 |
2 files changed, 30 insertions(+) |
19 |
|
20 |
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 |
21 |
new file mode 100644 |
22 |
index 00000000000..00df55f872d |
23 |
--- /dev/null |
24 |
+++ b/dev-vcs/git-pw/files/git-pw-2.1.1-test.patch |
25 |
@@ -0,0 +1,28 @@ |
26 |
+From 08152c86d02c36c425047fa9220d6d5ac3fcda01 Mon Sep 17 00:00:00 2001 |
27 |
+From: Matt Smith <matt@×××××××××.uk> |
28 |
+Date: Sun, 26 Sep 2021 19:55:40 +0100 |
29 |
+Subject: [PATCH] tests: Unset PAGER env when testing fallback |
30 |
+ |
31 |
+Prior to this commit, the test test_echo_via_pager_env_default will |
32 |
+fail when $PAGER is set to /usr/bin/less (or anything other than |
33 |
+"less"). Use unittest.mock to unset the environment variable during |
34 |
+the test. |
35 |
+--- |
36 |
+ tests/test_utils.py | 1 + |
37 |
+ 1 file changed, 1 insertion(+) |
38 |
+ |
39 |
+diff --git a/tests/test_utils.py b/tests/test_utils.py |
40 |
+index cf75a55..a0974f1 100644 |
41 |
+--- a/tests/test_utils.py |
42 |
++++ b/tests/test_utils.py |
43 |
+@@ -75,6 +75,7 @@ def test_echo_via_pager_env_PAGER(mock_inner, mock_tabulate, mock_config): |
44 |
+ @mock.patch.object(utils, 'git_config', return_value=None) |
45 |
+ @mock.patch.object(utils, '_tabulate') |
46 |
+ @mock.patch.object(utils, '_echo_via_pager') |
47 |
++@××××××××××.dict(os.environ, {'PAGER': ''}) |
48 |
+ def test_echo_via_pager_env_default(mock_inner, mock_tabulate, mock_config): |
49 |
+ utils.echo_via_pager('test', ('foo',), None) |
50 |
+ |
51 |
+-- |
52 |
+2.33.0 |
53 |
+ |
54 |
|
55 |
diff --git a/dev-vcs/git-pw/git-pw-2.1.1.ebuild b/dev-vcs/git-pw/git-pw-2.1.1.ebuild |
56 |
index a27a91f9a2c..dd63e27b733 100644 |
57 |
--- a/dev-vcs/git-pw/git-pw-2.1.1.ebuild |
58 |
+++ b/dev-vcs/git-pw/git-pw-2.1.1.ebuild |
59 |
@@ -21,6 +21,8 @@ LICENSE="MIT" |
60 |
SLOT="0" |
61 |
IUSE="" |
62 |
|
63 |
+PATCHES=( "${FILESDIR}/${P}-test.patch" ) |
64 |
+ |
65 |
RDEPEND=" |
66 |
>=dev-python/arrow-0.10[${PYTHON_USEDEP}] |
67 |
<dev-python/click-8.0[${PYTHON_USEDEP}] |