Skip to content

Commit

Permalink
test: use PYTHON executable from env in assertSnapshot
Browse files Browse the repository at this point in the history
PR-URL: #53938
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
  • Loading branch information
aduh95 authored and RafaelGSS committed Aug 5, 2024
1 parent 44a08f7 commit 58cb0dd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/common/assertSnapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,11 @@ async function spawnAndAssert(filename, transform = (x) => x, { tty = false, ...
return;
}
const flags = common.parseTestFlags(filename);
const executable = tty ? path.join(__dirname, '../..', 'tools/pseudo-tty.py') : process.execPath;
const args = tty ? [process.execPath, ...flags, filename] : [...flags, filename];
const executable = tty ? (process.env.PYTHON || 'python3') : process.execPath;
const args =
tty ?
[path.join(__dirname, '../..', 'tools/pseudo-tty.py'), process.execPath, ...flags, filename] :
[...flags, filename];
const { stdout, stderr } = await common.spawnPromisified(executable, args, options);
await assertSnapshot(transform(`${stdout}${stderr}`), filename);
}
Expand Down

0 comments on commit 58cb0dd

Please sign in to comment.