@@ -13,12 +13,11 @@ import { ConfigurationTarget, Uri } from 'vscode';
1313import { IPythonExecutionFactory , StdErrError } from '../../../client/common/process/types' ;
1414import { IConfigurationService } from '../../../client/common/types' ;
1515import { clearCache } from '../../../client/common/utils/cacheUtils' ;
16- import { OSType } from '../../../client/common/utils/platform' ;
1716import { IServiceContainer } from '../../../client/ioc/types' ;
1817import { initializeExternalDependencies } from '../../../client/pythonEnvironments/common/externalDependencies' ;
19- import { clearPythonPathInWorkspaceFolder , isOs } from '../../common' ;
18+ import { clearPythonPathInWorkspaceFolder } from '../../common' ;
2019import { 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' ;
2221
2322use ( chaiAsPromised ) ;
2423
@@ -37,9 +36,9 @@ suite('PythonExecutableService', () => {
3736 }
3837 await clearPythonPathInWorkspaceFolder ( workspace4Path ) ;
3938 serviceContainer = ( await initialize ( ) ) . serviceContainer ;
40- initializeExternalDependencies ( serviceContainer ) ;
4139 } ) ;
4240 setup ( async ( ) => {
41+ initializeExternalDependencies ( serviceContainer ) ;
4342 configService = serviceContainer . get < IConfigurationService > ( IConfigurationService ) ;
4443 pythonExecFactory = serviceContainer . get < IPythonExecutionFactory > ( IPythonExecutionFactory ) ;
4544
@@ -56,12 +55,7 @@ suite('PythonExecutableService', () => {
5655 clearCache ( ) ;
5756 } ) ;
5857
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 ( ) => {
6559 await configService . updateSetting (
6660 'envFile' ,
6761 'someInvalidFile.env' ,
@@ -76,16 +70,9 @@ suite('PythonExecutableService', () => {
7670 } ) ;
7771
7872 await expect ( promise ) . to . eventually . be . rejectedWith ( StdErrError ) ;
73+ } ) . timeout ( TEST_TIMEOUT * 3 ) ;
7974
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 ( ) => {
8976 await configService . updateSetting ( 'envFile' , undefined , workspace4PyFile , ConfigurationTarget . WorkspaceFolder ) ;
9077 const pythonExecService = await pythonExecFactory . create ( { resource : workspace4PyFile } ) ;
9178 const promise = pythonExecService . exec ( [ workspace4PyFile . fsPath ] , {
@@ -94,48 +81,27 @@ suite('PythonExecutableService', () => {
9481 } ) ;
9582
9683 await expect ( promise ) . to . eventually . have . property ( 'stdout' , `Hello${ EOL } ` ) ;
84+ } ) . timeout ( TEST_TIMEOUT * 3 ) ;
9785
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 ( ) => {
10787 const pythonExecService = await pythonExecFactory . create ( { resource : workspace4PyFile } ) ;
10888 const osModuleIsInstalled = pythonExecService . isModuleInstalled ( 'os' ) ;
10989 const sysModuleIsInstalled = pythonExecService . isModuleInstalled ( 'sys' ) ;
11090 await expect ( osModuleIsInstalled ) . to . eventually . equal ( true , 'os module is not installed' ) ;
11191 await expect ( sysModuleIsInstalled ) . to . eventually . equal ( true , 'sys module is not installed' ) ;
92+ } ) . timeout ( TEST_TIMEOUT * 3 ) ;
11293
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 ( ) => {
12295 const pythonExecService = await pythonExecFactory . create ( { resource : workspace4PyFile } ) ;
12396 const randomModuleName = `xyz123${ new Date ( ) . getSeconds ( ) } ` ;
12497 const randomModuleIsInstalled = pythonExecService . isModuleInstalled ( randomModuleName ) ;
12598 await expect ( randomModuleIsInstalled ) . to . eventually . equal (
12699 false ,
127100 `Random module '${ randomModuleName } ' is installed` ,
128101 ) ;
102+ } ) . timeout ( TEST_TIMEOUT * 3 ) ;
129103
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 ( ) => {
139105 const { pythonPath } = getExtensionSettings ( workspace4Path ) ;
140106 let expectedExecutablePath : string ;
141107 if ( await fs . pathExists ( pythonPath ) ) {
@@ -150,7 +116,5 @@ suite('PythonExecutableService', () => {
150116 const pythonExecService = await pythonExecFactory . create ( { resource : workspace4PyFile } ) ;
151117 const executablePath = await pythonExecService . getExecutablePath ( ) ;
152118 expect ( executablePath ) . to . equal ( expectedExecutablePath , 'Executable paths are not the same' ) ;
153-
154- return undefined ;
155- } ) ;
119+ } ) . timeout ( TEST_TIMEOUT * 3 ) ;
156120} ) ;
0 commit comments