Skip to content

Commit

Permalink
Change the failure output slightly
Browse files Browse the repository at this point in the history
Try to print a usable shell command:
 * use str() so that we don't get "PosixPath()" in the args list
 * join the arguments into a single string

This means that I can now copy paste the command and reproduce the
problem by just being in the same directory with assets.

Signed-off-by: Jussi Kukkonen <[email protected]>
  • Loading branch information
jku committed Oct 13, 2023
1 parent 15d0d15 commit 46369ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
CERTIFICATE_OIDC_ISSUER = "https://token.actions.githubusercontent.com"

_CLIENT_ERROR_MSG = """
Arguments: {args}
Command: {command}
Exit code: {exitcode}
!!! STDOUT !!!
Expand Down Expand Up @@ -135,7 +135,7 @@ def run(self, *args) -> None:
except subprocess.CalledProcessError as cpe:
msg = _CLIENT_ERROR_MSG.format(
exitcode=cpe.returncode,
args=cpe.args,
command=" ".join(map(str, cpe.args)),
stdout=cpe.stdout,
stderr=cpe.stderr,
)
Expand All @@ -151,7 +151,7 @@ def raises(self):
assert self.completed_process
msg = _CLIENT_ERROR_MSG.format(
exitcode=self.completed_process.returncode,
args=self.completed_process.args,
command=" ".join(map(str, self.completed_process.args)),
stdout=self.completed_process.stdout,
stderr=self.completed_process.stderr,
)
Expand Down

0 comments on commit 46369ea

Please sign in to comment.