@@ -5,7 +5,6 @@ import { expect } from 'chai';
55import { anything , instance , mock , verify , when } from 'ts-mockito' ;
66import { ConfigurationChangeEvent , Disposable , EventEmitter , TextEditor , Uri } from 'vscode' ;
77
8- import { nbformat } from '@jupyterlab/coreutils' ;
98import * as sinon from 'sinon' ;
109import { ApplicationShell } from '../../../client/common/application/applicationShell' ;
1110import { CommandManager } from '../../../client/common/application/commandManager' ;
@@ -25,7 +24,7 @@ import { ConfigurationService } from '../../../client/common/configuration/servi
2524import { LiveShareApi } from '../../../client/common/liveshare/liveshare' ;
2625import { FileSystem } from '../../../client/common/platform/fileSystem' ;
2726import { IFileSystem } from '../../../client/common/platform/types' ;
28- import { IConfigurationService , Version } from '../../../client/common/types' ;
27+ import { IConfigurationService } from '../../../client/common/types' ;
2928import { CodeCssGenerator } from '../../../client/datascience/codeCssGenerator' ;
3029import { DataViewerProvider } from '../../../client/datascience/data-viewing/dataViewerProvider' ;
3130import { DataScienceErrorHandler } from '../../../client/datascience/errorHandler/errorHandler' ;
@@ -54,7 +53,6 @@ import { IInterpreterService } from '../../../client/interpreter/contracts';
5453import { InterpreterService } from '../../../client/interpreter/interpreterService' ;
5554import { createEmptyCell } from '../../../datascience-ui/interactive-common/mainState' ;
5655import { waitForCondition } from '../../common' ;
57- import { noop } from '../../core' ;
5856import { MockMemento } from '../../mocks/mementos' ;
5957import { MockStatusProvider } from '../mockStatusProvider' ;
6058
@@ -421,60 +419,6 @@ suite('Data Science - Native Editor', () => {
421419 expect ( newEditor . cells ) . to . be . lengthOf ( 3 ) ;
422420 } ) ;
423421
424- test ( 'Python version info is not queried on creating a blank editor' , async ( ) => {
425- const file = Uri . parse ( 'file:///Untitled1.ipynb' ) ;
426-
427- // When a cell is executed, then ensure we store the python version info in the notebook data.
428- when ( executionProvider . getUsableJupyterPython ( ) ) . thenReject ( ) ;
429-
430- const editor = createEditor ( ) ;
431- await editor . load ( '' , file ) ;
432-
433- try {
434- await editor . getContents ( ) ;
435- expect ( false , 'Did not throw an error' ) ;
436- } catch {
437- // This should throw an error
438- noop ( ) ;
439- }
440- } ) ;
441-
442- test ( 'Pyton version info will be updated in notebook when a cell has been executed' , async ( ) => {
443- const file = Uri . parse ( 'file:///foo.ipynb' ) ;
444-
445- const editor = createEditor ( ) ;
446- await editor . load ( baseFile , file ) ;
447- expect ( await editor . getContents ( ) ) . to . be . equal ( baseFile ) ;
448- // At the begining version info is NOT in the file (at least not the same as what we are using to run cells).
449- let contents = JSON . parse ( await editor . getContents ( ) ) as nbformat . INotebookContent ;
450- expect ( contents . metadata ! . language_info ! . version ) . to . not . equal ( '10.11.12' ) ;
451-
452- // When a cell is executed, then ensure we store the python version info in the notebook data.
453- const version : Version = { build : [ ] , major : 10 , minor : 11 , patch : 12 , prerelease : [ ] , raw : '10.11.12' } ;
454- when ( executionProvider . getUsableJupyterPython ( ) ) . thenResolve ( ( { version } as any ) ) ;
455-
456- try {
457- editor . onMessage ( InteractiveWindowMessages . SubmitNewCell , { code : 'hello' , id : '1' } ) ;
458- } catch {
459- // Ignore errors related to running cells, assume that works.
460- noop ( ) ;
461- }
462-
463- // Wait for the version info to be retrieved (done in the background).
464- await waitForCondition ( async ( ) => {
465- try {
466- verify ( executionProvider . getUsableJupyterPython ( ) ) . atLeast ( 1 ) ;
467- return true ;
468- } catch {
469- return false ;
470- }
471- } , 5_000 , 'Timeout' ) ;
472-
473- // Verify the version info is in the notbook.
474- contents = JSON . parse ( await editor . getContents ( ) ) as nbformat . INotebookContent ;
475- expect ( contents . metadata ! . language_info ! . version ) . to . equal ( '10.11.12' ) ;
476- } ) ;
477-
478422 test ( 'Opening file with local storage but no global will still open with old contents' , async ( ) => {
479423 // This test is really for making sure when a user upgrades to a new extension, we still have their old storage
480424 const file = Uri . parse ( 'file:///foo.ipynb' ) ;
0 commit comments