Skip to content

Commit ac052a5

Browse files
committed
test: use active Python for release packaging test
- pass sys.executable to release-package.sh through PYTHON - include captured stdout and stderr when the integration script fails
1 parent b971d37 commit ac052a5

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

tests/test_release.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
from __future__ import annotations
44

55
import io
6+
import os
67
import shutil
78
import subprocess
9+
import sys
810
import tarfile
911
from pathlib import Path
1012
from types import SimpleNamespace
@@ -174,13 +176,20 @@ def fake_download(url, dest):
174176

175177
def test_release_package_excludes_python_cache_files():
176178
repo = Path(__file__).resolve().parents[1]
177-
subprocess.run(
179+
env = os.environ.copy()
180+
env["PYTHON"] = sys.executable
181+
result = subprocess.run(
178182
["bash", "scripts/release-package.sh", "v9.9.9"],
179183
cwd=repo,
180-
check=True,
184+
env=env,
181185
capture_output=True,
182186
text=True,
183187
)
188+
assert result.returncode == 0, (
189+
f"release-package.sh failed with {result.returncode}\n"
190+
f"stdout:\n{result.stdout}\n"
191+
f"stderr:\n{result.stderr}"
192+
)
184193

185194
archive = repo / "dist" / "git-auto-sync-v9.9.9-release.tar.gz"
186195
with tarfile.open(archive, "r:gz") as tf:

0 commit comments

Comments
 (0)