@@ -14,38 +14,22 @@ import * as mocks from './mockClasses';
1414import { KernelRestartedError , KernelShutdownError } from '../client/jupyter/common/errors' ;
1515import { createDeferred } from '../client/common/helpers' ;
1616import { KernelspecMetadata } from '../client/jupyter/contracts' ;
17- import { execPythonFile } from '../client/common/utils' ;
1817import * as settings from '../client/common/configSettings' ;
1918let pythonSettings = settings . PythonSettings . getInstance ( ) ;
2019
2120suiteSetup ( done => {
2221 initialize ( ) . then ( ( ) => {
23- if ( ! IS_TRAVIS ) {
24- return done ( ) ;
25- }
26-
27- new Promise < string > ( resolve => {
28- // Support for travis
29- let version = process . env [ 'TRAVIS_PYTHON_VERSION' ] ;
30- if ( typeof version === 'string' ) {
31- console . log ( 'Version from travis is ' + version ) ;
32- }
33- console . log ( 'Path used is ' + PYTHON_PATH ) ;
34- // Support for local tests
35- execPythonFile ( PYTHON_PATH , [ '--version' ] , __dirname , true ) . then ( resolve ) ;
36- } ) . then ( version => {
37- console . log ( 'Version returned is ' + version ) ;
22+ if ( IS_TRAVIS ) {
3823 pythonSettings . pythonPath = PYTHON_PATH ;
39- done ( ) ;
40- } ) ;
24+ }
25+ done ( ) ;
4126 } ) ;
4227} ) ;
4328
4429// Defines a Mocha test suite to group tests of similar kind together
4530suite ( 'JupyterClient' , ( ) => {
4631 test ( 'Ping (Process and Socket)' , done => {
4732 const output = new mocks . MockOutputChannel ( 'Jupyter' ) ;
48- output . writeToConsole = true ;
4933 const jupyter = new JupyterClientAdapter ( output , __dirname ) ;
5034 jupyter . start ( { 'PYTHON_DONJAYAMANNE_TEST' : '1' } ) . then ( ( ) => {
5135 done ( ) ;
@@ -57,7 +41,6 @@ suite('JupyterClient', () => {
5741 test ( 'Start Jupyter Adapter (Socket Client)' , done => {
5842 process . env [ 'PYTHON_DONJAYAMANNE_TEST' ] = '0' ;
5943 const output = new mocks . MockOutputChannel ( 'Jupyter' ) ;
60- output . writeToConsole = true ;
6144 const jupyter = new JupyterClientAdapter ( output , __dirname ) ;
6245 jupyter . start ( ) . then ( ( ) => {
6346 done ( ) ;
@@ -70,7 +53,6 @@ suite('JupyterClient', () => {
7053 test ( 'List Kernels (with start)' , done => {
7154 process . env [ 'PYTHON_DONJAYAMANNE_TEST' ] = '0' ;
7255 const output = new mocks . MockOutputChannel ( 'Jupyter' ) ;
73- output . writeToConsole = true ;
7456 const jupyter = new JupyterClientAdapter ( output , __dirname ) ;
7557 jupyter . start ( ) . then ( ( ) => {
7658 return jupyter . getAllKernelSpecs ( ) ;
@@ -86,7 +68,6 @@ suite('JupyterClient', () => {
8668 test ( 'List Kernels (without starting)' , done => {
8769 process . env [ 'PYTHON_DONJAYAMANNE_TEST' ] = '0' ;
8870 const output = new mocks . MockOutputChannel ( 'Jupyter' ) ;
89- output . writeToConsole = true ;
9071 const jupyter = new JupyterClientAdapter ( output , __dirname ) ;
9172 jupyter . getAllKernelSpecs ( ) . then ( kernelSpecs => {
9273 assert . notEqual ( Object . keys ( kernelSpecs ) . length , 0 , 'kernelSpecs not found' ) ;
@@ -101,7 +82,6 @@ suite('JupyterClient', () => {
10182 test ( 'Start Kernel (with start)' , done => {
10283 process . env [ 'PYTHON_DONJAYAMANNE_TEST' ] = '0' ;
10384 const output = new mocks . MockOutputChannel ( 'Jupyter' ) ;
104- output . writeToConsole = true ;
10585 const jupyter = new JupyterClientAdapter ( output , __dirname ) ;
10686 jupyter . start ( ) . then ( ( ) => {
10787 return jupyter . getAllKernelSpecs ( ) ;
@@ -123,7 +103,6 @@ suite('JupyterClient', () => {
123103 } ) ;
124104 test ( 'Start Kernel (without start)' , done => {
125105 const output = new mocks . MockOutputChannel ( 'Jupyter' ) ;
126- output . writeToConsole = true ;
127106 const jupyter = new JupyterClientAdapter ( output , __dirname ) ;
128107 process . env [ 'PYTHON_DONJAYAMANNE_TEST' ] = '0' ;
129108 jupyter . getAllKernelSpecs ( ) . then ( kernelSpecs => {
@@ -154,7 +133,6 @@ suite('JupyterClient', () => {
154133 test ( 'Execute Code (success)' , done => {
155134 process . env [ 'PYTHON_DONJAYAMANNE_TEST' ] = '0' ;
156135 const output = new mocks . MockOutputChannel ( 'Jupyter' ) ;
157- output . writeToConsole = true ;
158136 const jupyter = new JupyterClientAdapter ( output , __dirname ) ;
159137 jupyter . start ( ) . then ( ( ) => {
160138 return jupyter . getAllKernelSpecs ( ) ;
@@ -184,7 +162,6 @@ suite('JupyterClient', () => {
184162 test ( 'Execute Code (with threads)' , done => {
185163 process . env [ 'PYTHON_DONJAYAMANNE_TEST' ] = '0' ;
186164 const output = new mocks . MockOutputChannel ( 'Jupyter' ) ;
187- output . writeToConsole = true ;
188165 const jupyter = new JupyterClientAdapter ( output , __dirname ) ;
189166 jupyter . start ( ) . then ( ( ) => {
190167 return jupyter . getAllKernelSpecs ( ) ;
@@ -215,7 +192,6 @@ suite('JupyterClient', () => {
215192 test ( 'Execute Code (failure)' , done => {
216193 process . env [ 'PYTHON_DONJAYAMANNE_TEST' ] = '0' ;
217194 const output = new mocks . MockOutputChannel ( 'Jupyter' ) ;
218- output . writeToConsole = true ;
219195 const jupyter = new JupyterClientAdapter ( output , __dirname ) ;
220196 jupyter . start ( ) . then ( ( ) => {
221197 return jupyter . getAllKernelSpecs ( ) ;
@@ -245,7 +221,6 @@ suite('JupyterClient', () => {
245221 test ( 'Shutdown Kernel' , done => {
246222 process . env [ 'PYTHON_DONJAYAMANNE_TEST' ] = '0' ;
247223 const output = new mocks . MockOutputChannel ( 'Jupyter' ) ;
248- output . writeToConsole = true ;
249224 const jupyter = new JupyterClientAdapter ( output , __dirname ) ;
250225 jupyter . start ( ) . then ( ( ) => {
251226 return jupyter . getAllKernelSpecs ( ) ;
@@ -271,7 +246,6 @@ suite('JupyterClient', () => {
271246 test ( 'Shutdown while executing code' , done => {
272247 process . env [ 'PYTHON_DONJAYAMANNE_TEST' ] = '0' ;
273248 const output = new mocks . MockOutputChannel ( 'Jupyter' ) ;
274- output . writeToConsole = true ;
275249 const jupyter = new JupyterClientAdapter ( output , __dirname ) ;
276250 jupyter . start ( ) . then ( ( ) => {
277251 return jupyter . getAllKernelSpecs ( ) ;
@@ -314,7 +288,6 @@ suite('JupyterClient', () => {
314288 test ( 'Execute code after shutdowning down when executing code' , done => {
315289 process . env [ 'PYTHON_DONJAYAMANNE_TEST' ] = '0' ;
316290 const output = new mocks . MockOutputChannel ( 'Jupyter' ) ;
317- output . writeToConsole = true ;
318291 const jupyter = new JupyterClientAdapter ( output , __dirname ) ;
319292 let kernelSpecUsed : KernelspecMetadata ;
320293 jupyter . start ( ) . then ( ( ) => {
@@ -372,7 +345,6 @@ suite('JupyterClient', () => {
372345 test ( 'Interrupt Kernel' , done => {
373346 process . env [ 'PYTHON_DONJAYAMANNE_TEST' ] = '0' ;
374347 const output = new mocks . MockOutputChannel ( 'Jupyter' ) ;
375- output . writeToConsole = true ;
376348 const jupyter = new JupyterClientAdapter ( output , __dirname ) ;
377349 jupyter . start ( ) . then ( ( ) => {
378350 return jupyter . getAllKernelSpecs ( ) ;
@@ -401,7 +373,6 @@ suite('JupyterClient', () => {
401373 test ( 'Interrupt Kernel while executing code' , done => {
402374 process . env [ 'PYTHON_DONJAYAMANNE_TEST' ] = '0' ;
403375 const output = new mocks . MockOutputChannel ( 'Jupyter' ) ;
404- output . writeToConsole = true ;
405376 const jupyter = new JupyterClientAdapter ( output , __dirname ) ;
406377 jupyter . start ( ) . then ( ( ) => {
407378 return jupyter . getAllKernelSpecs ( ) ;
@@ -440,7 +411,7 @@ suite('JupyterClient', () => {
440411 test ( 'Restart Kernel' , done => {
441412 process . env [ 'PYTHON_DONJAYAMANNE_TEST' ] = '0' ;
442413 const output = new mocks . MockOutputChannel ( 'Jupyter' ) ;
443- output . writeToConsole = true ;
414+
444415 const jupyter = new JupyterClientAdapter ( output , __dirname ) ;
445416 jupyter . start ( ) . then ( ( ) => {
446417 return jupyter . getAllKernelSpecs ( ) ;
@@ -466,7 +437,6 @@ suite('JupyterClient', () => {
466437 test ( 'Restart while executing code' , done => {
467438 process . env [ 'PYTHON_DONJAYAMANNE_TEST' ] = '0' ;
468439 const output = new mocks . MockOutputChannel ( 'Jupyter' ) ;
469- output . writeToConsole = true ;
470440 const jupyter = new JupyterClientAdapter ( output , __dirname ) ;
471441 jupyter . start ( ) . then ( ( ) => {
472442 return jupyter . getAllKernelSpecs ( ) ;
@@ -508,7 +478,6 @@ suite('JupyterClient', () => {
508478 test ( 'Execute multiple blocks of Code' , done => {
509479 process . env [ 'PYTHON_DONJAYAMANNE_TEST' ] = '0' ;
510480 const output = new mocks . MockOutputChannel ( 'Jupyter' ) ;
511- output . writeToConsole = true ;
512481 const jupyter = new JupyterClientAdapter ( output , __dirname ) ;
513482 jupyter . start ( ) . then ( ( ) => {
514483 return jupyter . getAllKernelSpecs ( ) ;
@@ -567,7 +536,6 @@ suite('JupyterClient', () => {
567536 test ( 'Status change' , done => {
568537 process . env [ 'PYTHON_DONJAYAMANNE_TEST' ] = '0' ;
569538 const output = new mocks . MockOutputChannel ( 'Jupyter' ) ;
570- output . writeToConsole = true ;
571539 const jupyter = new JupyterClientAdapter ( output , __dirname ) ;
572540 jupyter . start ( ) . then ( ( ) => {
573541 return jupyter . getAllKernelSpecs ( ) ;
0 commit comments