From: "Arthur Zamarin" <arthurzam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/pkgcore/pkgcore:master commit in: src/pkgcore/pytest/
Date: Tue, 23 Jan 2024 19:01:32 +0000 (UTC) [thread overview]
Message-ID: <1705999132.7a535fb3d2315fb6b73f3346fbd53468e48ccbfc.arthurzam@gentoo> (raw)
commit: 7a535fb3d2315fb6b73f3346fbd53468e48ccbfc
Author: Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Mon Jan 22 03:20:33 2024 +0000
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Tue Jan 23 08:38:52 2024 +0000
URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=7a535fb3
fix: suppress $HOME for tests.
Suppressing $HOME is necessary for hygenic tests; to avoid
anything in the dev's environment becoming relied upon for
the test passing.
A slightly more salient point for me; every `git commit` test
was asking for my gpg unlock for git commits; obviously annoying,
also obviously unhygenic (I could have modified default git commit
template for example).
Signed-off-by: Brian Harring <ferringb <AT> gmail.com>
src/pkgcore/pytest/plugin.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/pkgcore/pytest/plugin.py b/src/pkgcore/pytest/plugin.py
index 0579a45ad..d7231dd3c 100644
--- a/src/pkgcore/pytest/plugin.py
+++ b/src/pkgcore/pytest/plugin.py
@@ -41,6 +41,8 @@ class GitRepo:
self.add(pjoin(self.path, ".init"), create=True)
def run(self, cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, **kwargs):
+ env = os.environ.copy()
+ env["HOME"] = self.path
return subprocess.run(
cmd,
cwd=self.path,
@@ -48,6 +50,7 @@ class GitRepo:
check=True,
stdout=stdout,
stderr=stderr,
+ env=env,
**kwargs,
)
next reply other threads:[~2024-01-23 19:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-23 19:01 Arthur Zamarin [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-01-15 6:33 [gentoo-commits] proj/pkgcore/pkgcore:master commit in: src/pkgcore/pytest/ Arthur Zamarin
2023-04-20 18:41 Arthur Zamarin
2022-11-07 19:01 Arthur Zamarin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1705999132.7a535fb3d2315fb6b73f3346fbd53468e48ccbfc.arthurzam@gentoo \
--to=arthurzam@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox