[python] Fix error message for discontinued Python 3.6 (#8300)

This fixes the error message when a discontinued version of python (for example, Python 3.6) is detected.

https://vercel.com/changelog/python-3-6-is-being-deprecated
This commit is contained in:
Steven
2022-08-03 13:09:03 -04:00
committed by GitHub
parent 21ff4a58c3
commit 73446e544a
10 changed files with 103 additions and 5 deletions

View File

@@ -71,8 +71,30 @@ it('should match the probes against Python dev servers', async () => {
}
});
const testsThatFailToBuild = new Map([
['30-fail-build-invalid-pipfile', 'Unable to parse Pipfile.lock'],
[
'31-fail-build-invalid-python36',
'Python version "3.6" detected in Pipfile.lock is discontinued and must be upgraded.',
],
]);
// eslint-disable-next-line no-restricted-syntax
for (const fixture of fs.readdirSync(fixturesPath)) {
const errMsg = testsThatFailToBuild.get(fixture);
if (errMsg) {
// eslint-disable-next-line no-loop-func
it(`should fail to build ${fixture}`, async () => {
try {
await testDeployment(path.join(fixturesPath, fixture));
} catch (err) {
expect(err).toBeTruthy();
expect(err.deployment).toBeTruthy();
expect(err.deployment.errorMessage).toBe(errMsg);
}
});
continue; //eslint-disable-line
}
// eslint-disable-next-line no-loop-func
it(`should build ${fixture}`, async () => {
await expect(