@@ -13,12 +13,11 @@ import { ConfigurationTarget, Uri } from 'vscode';
13
13
import { IPythonExecutionFactory , StdErrError } from '../../../client/common/process/types' ;
14
14
import { IConfigurationService } from '../../../client/common/types' ;
15
15
import { clearCache } from '../../../client/common/utils/cacheUtils' ;
16
- import { OSType } from '../../../client/common/utils/platform' ;
17
16
import { IServiceContainer } from '../../../client/ioc/types' ;
18
17
import { initializeExternalDependencies } from '../../../client/pythonEnvironments/common/externalDependencies' ;
19
- import { clearPythonPathInWorkspaceFolder , isOs } from '../../common' ;
18
+ import { clearPythonPathInWorkspaceFolder } from '../../common' ;
20
19
import { getExtensionSettings } from '../../extensionSettings' ;
21
- import { closeActiveWindows , initialize , initializeTest , IS_MULTI_ROOT_TEST } from '../../initialize' ;
20
+ import { closeActiveWindows , initialize , initializeTest , IS_MULTI_ROOT_TEST , TEST_TIMEOUT } from '../../initialize' ;
22
21
23
22
use ( chaiAsPromised ) ;
24
23
@@ -37,9 +36,9 @@ suite('PythonExecutableService', () => {
37
36
}
38
37
await clearPythonPathInWorkspaceFolder ( workspace4Path ) ;
39
38
serviceContainer = ( await initialize ( ) ) . serviceContainer ;
40
- initializeExternalDependencies ( serviceContainer ) ;
41
39
} ) ;
42
40
setup ( async ( ) => {
41
+ initializeExternalDependencies ( serviceContainer ) ;
43
42
configService = serviceContainer . get < IConfigurationService > ( IConfigurationService ) ;
44
43
pythonExecFactory = serviceContainer . get < IPythonExecutionFactory > ( IPythonExecutionFactory ) ;
45
44
@@ -56,12 +55,7 @@ suite('PythonExecutableService', () => {
56
55
clearCache ( ) ;
57
56
} ) ;
58
57
59
- test ( 'Importing without a valid PYTHONPATH should fail' , async function ( ) {
60
- // Timing out on Windows, tracked by #18337.
61
- if ( isOs ( OSType . Windows ) ) {
62
- return this . skip ( ) ;
63
- }
64
-
58
+ test ( 'Importing without a valid PYTHONPATH should fail' , async ( ) => {
65
59
await configService . updateSetting (
66
60
'envFile' ,
67
61
'someInvalidFile.env' ,
@@ -76,16 +70,9 @@ suite('PythonExecutableService', () => {
76
70
} ) ;
77
71
78
72
await expect ( promise ) . to . eventually . be . rejectedWith ( StdErrError ) ;
73
+ } ) . timeout ( TEST_TIMEOUT * 3 ) ;
79
74
80
- return undefined ;
81
- } ) ;
82
-
83
- test ( 'Importing with a valid PYTHONPATH from .env file should succeed' , async function ( ) {
84
- // Timing out on Windows, tracked by #18337.
85
- if ( isOs ( OSType . Windows ) ) {
86
- return this . skip ( ) ;
87
- }
88
-
75
+ test ( 'Importing with a valid PYTHONPATH from .env file should succeed' , async ( ) => {
89
76
await configService . updateSetting ( 'envFile' , undefined , workspace4PyFile , ConfigurationTarget . WorkspaceFolder ) ;
90
77
const pythonExecService = await pythonExecFactory . create ( { resource : workspace4PyFile } ) ;
91
78
const promise = pythonExecService . exec ( [ workspace4PyFile . fsPath ] , {
@@ -94,48 +81,27 @@ suite('PythonExecutableService', () => {
94
81
} ) ;
95
82
96
83
await expect ( promise ) . to . eventually . have . property ( 'stdout' , `Hello${ EOL } ` ) ;
84
+ } ) . timeout ( TEST_TIMEOUT * 3 ) ;
97
85
98
- return undefined ;
99
- } ) ;
100
-
101
- test ( "Known modules such as 'os' and 'sys' should be deemed 'installed'" , async function ( ) {
102
- // Timing out on Windows, tracked by #18337.
103
- if ( isOs ( OSType . Windows ) ) {
104
- return this . skip ( ) ;
105
- }
106
-
86
+ test ( "Known modules such as 'os' and 'sys' should be deemed 'installed'" , async ( ) => {
107
87
const pythonExecService = await pythonExecFactory . create ( { resource : workspace4PyFile } ) ;
108
88
const osModuleIsInstalled = pythonExecService . isModuleInstalled ( 'os' ) ;
109
89
const sysModuleIsInstalled = pythonExecService . isModuleInstalled ( 'sys' ) ;
110
90
await expect ( osModuleIsInstalled ) . to . eventually . equal ( true , 'os module is not installed' ) ;
111
91
await expect ( sysModuleIsInstalled ) . to . eventually . equal ( true , 'sys module is not installed' ) ;
92
+ } ) . timeout ( TEST_TIMEOUT * 3 ) ;
112
93
113
- return undefined ;
114
- } ) ;
115
-
116
- test ( "Unknown modules such as 'xyzabc123' be deemed 'not installed'" , async function ( ) {
117
- // Timing out on Windows, tracked by #18337.
118
- if ( isOs ( OSType . Windows ) ) {
119
- return this . skip ( ) ;
120
- }
121
-
94
+ test ( "Unknown modules such as 'xyzabc123' be deemed 'not installed'" , async ( ) => {
122
95
const pythonExecService = await pythonExecFactory . create ( { resource : workspace4PyFile } ) ;
123
96
const randomModuleName = `xyz123${ new Date ( ) . getSeconds ( ) } ` ;
124
97
const randomModuleIsInstalled = pythonExecService . isModuleInstalled ( randomModuleName ) ;
125
98
await expect ( randomModuleIsInstalled ) . to . eventually . equal (
126
99
false ,
127
100
`Random module '${ randomModuleName } ' is installed` ,
128
101
) ;
102
+ } ) . timeout ( TEST_TIMEOUT * 3 ) ;
129
103
130
- return undefined ;
131
- } ) ;
132
-
133
- test ( 'Ensure correct path to executable is returned' , async function ( ) {
134
- // Timing out on Windows, tracked by #18337.
135
- if ( isOs ( OSType . Windows ) ) {
136
- return this . skip ( ) ;
137
- }
138
-
104
+ test ( 'Ensure correct path to executable is returned' , async ( ) => {
139
105
const { pythonPath } = getExtensionSettings ( workspace4Path ) ;
140
106
let expectedExecutablePath : string ;
141
107
if ( await fs . pathExists ( pythonPath ) ) {
@@ -150,7 +116,5 @@ suite('PythonExecutableService', () => {
150
116
const pythonExecService = await pythonExecFactory . create ( { resource : workspace4PyFile } ) ;
151
117
const executablePath = await pythonExecService . getExecutablePath ( ) ;
152
118
expect ( executablePath ) . to . equal ( expectedExecutablePath , 'Executable paths are not the same' ) ;
153
-
154
- return undefined ;
155
- } ) ;
119
+ } ) . timeout ( TEST_TIMEOUT * 3 ) ;
156
120
} ) ;
0 commit comments