@@ -33,7 +33,7 @@ import { IServiceContainer } from '../../../client/ioc/types';
3333import { EnvironmentType , PythonEnvironment } from '../../../client/pythonEnvironments/info' ;
3434import { CodeExecutionHelper } from '../../../client/terminals/codeExecution/helper' ;
3535import { ICodeExecutionHelper } from '../../../client/terminals/types' ;
36- import { PYTHON_PATH } from '../../common' ;
36+ import { PYTHON_PATH , getPythonSemVer } from '../../common' ;
3737import { ReplType } from '../../../client/repl/types' ;
3838
3939const TEST_FILES_PATH = path . join ( EXTENSION_ROOT_DIR , 'src' , 'test' , 'python_files' , 'terminalExec' ) ;
@@ -233,27 +233,28 @@ suite('Terminal - Code Execution Helper', async () => {
233233 const normalizedExpected = expectedSource . replace ( / \r \n / g, '\n' ) ;
234234 expect ( normalizedCode ) . to . be . equal ( normalizedExpected ) ;
235235 }
236-
237- [ '' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' ] . forEach ( ( fileNameSuffix ) => {
238- test ( `Ensure code is normalized (Sample${ fileNameSuffix } )` , async ( ) => {
239- configurationService
240- . setup ( ( c ) => c . getSettings ( TypeMoq . It . isAny ( ) ) )
241- . returns ( {
242- REPL : {
243- EnableREPLSmartSend : false ,
244- REPLSmartSend : false ,
245- } ,
246- // eslint-disable-next-line @typescript-eslint/no-explicit-any
247- } as any ) ;
248- const code = await fs . readFile ( path . join ( TEST_FILES_PATH , `sample${ fileNameSuffix } _raw.py` ) , 'utf8' ) ;
249- const expectedCode = await fs . readFile (
250- path . join ( TEST_FILES_PATH , `sample${ fileNameSuffix } _normalized_selection.py` ) ,
251- 'utf8' ,
252- ) ;
253- await ensureCodeIsNormalized ( code , expectedCode ) ;
236+ const pythonVersion = await getPythonSemVer ( ) ;
237+ if ( pythonVersion && pythonVersion . minor < 13 ) {
238+ [ '' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' ] . forEach ( ( fileNameSuffix ) => {
239+ test ( `Ensure code is normalized (Sample${ fileNameSuffix } )` , async ( ) => {
240+ configurationService
241+ . setup ( ( c ) => c . getSettings ( TypeMoq . It . isAny ( ) ) )
242+ . returns ( {
243+ REPL : {
244+ EnableREPLSmartSend : false ,
245+ REPLSmartSend : false ,
246+ } ,
247+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
248+ } as any ) ;
249+ const code = await fs . readFile ( path . join ( TEST_FILES_PATH , `sample${ fileNameSuffix } _raw.py` ) , 'utf8' ) ;
250+ const expectedCode = await fs . readFile (
251+ path . join ( TEST_FILES_PATH , `sample${ fileNameSuffix } _normalized_selection.py` ) ,
252+ 'utf8' ,
253+ ) ;
254+ await ensureCodeIsNormalized ( code , expectedCode ) ;
255+ } ) ;
254256 } ) ;
255- } ) ;
256-
257+ }
257258 test ( "Display message if there's no active file" , async ( ) => {
258259 documentManager . setup ( ( doc ) => doc . activeTextEditor ) . returns ( ( ) => undefined ) ;
259260
0 commit comments