[python] Mock Python for tests running on machines without Python actually installed (#10742)

This commit is contained in:
Chris Barber
2023-10-20 12:41:15 -05:00
committed by GitHub
parent de84743e10
commit 5d40da17ba
2 changed files with 4 additions and 0 deletions

View File

@@ -48,6 +48,7 @@ it('should ignore minor version in vercel dev', () => {
});
it('should select latest supported installed version when no Piplock detected', () => {
makeMockPython('3.10');
const result = getSupportedPythonVersion({ pipLockPythonVersion: undefined });
expect(result).toHaveProperty('runtime');
expect(result.runtime).toMatch(/^python3\.\d+$/);
@@ -55,6 +56,7 @@ it('should select latest supported installed version when no Piplock detected',
});
it('should select latest supported installed version and warn when invalid Piplock detected', () => {
makeMockPython('3.10');
const result = getSupportedPythonVersion({ pipLockPythonVersion: '999' });
expect(result).toHaveProperty('runtime');
expect(result.runtime).toMatch(/^python3\.\d+$/);