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 <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
  • Loading branch information
aduh95 authored and marco-ippolito committed Aug 19, 2024
1 parent 89599e0 commit edb75ae
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 edb75ae

Please sign in to comment.