Skip to content

Commit 1c44def

Browse files
author
Kartik Raj
authored
Disable sorting tests for Python 2.7 as isort5 is not compatible with Python 2.7 (#13550)
1 parent ac89952 commit 1c44def

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

news/3 Code Health/13542.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Disable sorting tests for Python 2.7 as isort5 is not compatible with Python 2.7.

requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# IntelliSense
22
jedi==0.17.2
33
# Sort Imports
4-
isort==5.3.2
4+
isort==5.3.2; python_version >= '3.6'
55
# DS Python daemon
66
python-jsonrpc-server==0.2.0

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
future==0.18.2 \
88
--hash=sha256:b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d \
99
# via python-jsonrpc-server
10-
isort==5.3.2 \
10+
isort==5.3.2 ; python_version >= "3.6" \
1111
--hash=sha256:5196bd2f5b23dc91215734b1c96c6d28390061d69860a948094c12635d6d64e6 \
1212
--hash=sha256:ba83762132a8661d3525f87a86549712fb7d8da79eeb452e01f327ada9e87920 \
1313
# via -r requirements.in

src/test/format/extension.sort.test.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,18 @@ suite('Sorting', () => {
2828
let ioc: UnitTestIocContainer;
2929
let sorter: ISortImportsEditingProvider;
3030
const configTarget = IS_MULTI_ROOT_TEST ? ConfigurationTarget.WorkspaceFolder : ConfigurationTarget.Workspace;
31-
suiteSetup(initialize);
31+
suiteSetup(async function () {
32+
const pythonVersion = process.env.CI_PYTHON_VERSION // GHA uses this
33+
? parseFloat(process.env.CI_PYTHON_VERSION)
34+
: process.env.PythonVersion // Azdo uses this
35+
? parseFloat(process.env.PythonVersion)
36+
: undefined;
37+
if (pythonVersion && pythonVersion < 3) {
38+
// tslint:disable-next-line:no-invalid-this
39+
return this.skip();
40+
}
41+
await initialize();
42+
});
3243
suiteTeardown(async () => {
3344
fs.writeFileSync(fileToFormatWithConfig, fs.readFileSync(originalFileToFormatWithConfig));
3445
fs.writeFileSync(fileToFormatWithConfig1, fs.readFileSync(originalFileToFormatWithConfig1));

0 commit comments

Comments
 (0)