From 9e280dbaab9858a753d9e00e87830d607ecfdb43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Tue, 14 Mar 2023 15:30:32 +0200 Subject: [PATCH] Report stderr contents if `flit build` fails --- tests/test_sdist.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_sdist.py b/tests/test_sdist.py index 413e3207..cc253b72 100644 --- a/tests/test_sdist.py +++ b/tests/test_sdist.py @@ -33,9 +33,12 @@ def test_compare_sdists(monkeypatch, tmp_path): (sdist_build,) = sdist_build_dir.glob("*.tar.gz") # Flit doesn't allow targeting directories, as far as I can tell - subprocess.run( - [sys.executable, "-m", "flit", "build", "--format=sdist"], check=True + process = subprocess.run( + [sys.executable, "-m", "flit", "build", "--format=sdist"], + stderr=subprocess.PIPE, ) + if process.returncode != 0: + pytest.fail(process.stderr.decode("utf-8")) (sdist_flit,) = Path("dist").glob("*.tar.gz")