Skip to content

Commit 2bc95d5

Browse files
Make variable exclude test less strict (microsoft#6527)
1 parent a16337b commit 2bc95d5

File tree

10 files changed

+119
-123
lines changed

10 files changed

+119
-123
lines changed

news/3 Code Health/6525.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix variable explorer exclude test to be less strict

src/datascience-ui/react-common/settingsReactSide.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export declare function getInitialSettings(): any;
1212

1313
let loadedSettings: IDataScienceExtraSettings;
1414

15-
export function getSettings() : IDataScienceExtraSettings {
15+
export function getSettings(): IDataScienceExtraSettings {
1616
if (loadedSettings === undefined) {
1717
load();
1818
}
@@ -51,7 +51,7 @@ function load() {
5151
markdownRegularExpression: '^(#\\s*%%\\s*\\[markdown\\]|#\\s*\\<markdowncell\\>)',
5252
codeRegularExpression: '^(#\\s*%%|#\\s*\\<codecell\\>|#\\s*In\\[\\d*?\\]|#\\s*In\\[ \\])',
5353
showJupyterVariableExplorer: true,
54-
variableExplorerExclude: 'module;builtin_function_or_method',
54+
variableExplorerExclude: 'module;function;builtin_function_or_method',
5555
enablePlotViewer: true,
5656
extraSettings: {
5757
editorCursor: 'line',

src/test/datascience/color.test.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ import { MockAutoSelectionService } from '../mocks/autoSelector';
1919
// tslint:disable:max-func-body-length
2020
suite('Theme colors', () => {
2121
let themeFinder: ThemeFinder;
22-
let extensions : Extensions;
23-
let currentProcess : CurrentProcess;
24-
let logger : Logger;
25-
let workspaceService : TypeMoq.IMock<IWorkspaceService>;
26-
let workspaceConfig : TypeMoq.IMock<WorkspaceConfiguration>;
22+
let extensions: Extensions;
23+
let currentProcess: CurrentProcess;
24+
let logger: Logger;
25+
let workspaceService: TypeMoq.IMock<IWorkspaceService>;
26+
let workspaceConfig: TypeMoq.IMock<WorkspaceConfiguration>;
2727
let cssGenerator: CodeCssGenerator;
28-
let configService : TypeMoq.IMock<IConfigurationService>;
29-
const settings : PythonSettings = new PythonSettings(undefined, new MockAutoSelectionService());
28+
let configService: TypeMoq.IMock<IConfigurationService>;
29+
const settings: PythonSettings = new PythonSettings(undefined, new MockAutoSelectionService());
3030

3131
setup(() => {
3232
extensions = new Extensions();
@@ -66,7 +66,7 @@ suite('Theme colors', () => {
6666
errorBackgroundColor: '#FFFFFF',
6767
sendSelectionToInteractiveWindow: false,
6868
showJupyterVariableExplorer: true,
69-
variableExplorerExclude: 'module;builtin_function_or_method',
69+
variableExplorerExclude: 'module;function;builtin_function_or_method',
7070
codeRegularExpression: '^(#\\s*%%|#\\s*\\<codecell\\>|#\\s*In\\[\\d*?\\]|#\\s*In\\[ \\])',
7171
markdownRegularExpression: '^(#\\s*%%\\s*\\[markdown\\]|#\\s*\\<markdowncell\\>)',
7272
enablePlotViewer: true
@@ -99,9 +99,9 @@ suite('Theme colors', () => {
9999
return 16;
100100
});
101101
workspaceConfig.setup(ws => ws.get(TypeMoq.It.isAnyString(), TypeMoq.It.isAny()))
102-
.returns((_s, d) => {
103-
return d;
104-
});
102+
.returns((_s, d) => {
103+
return d;
104+
});
105105
const theme = await cssGenerator.generateMonacoTheme(isDark, themeName);
106106
assert.ok(theme, `Cannot find monaco theme for ${themeName}`);
107107
const colors = await cssGenerator.generateThemeCss(isDark, themeName);

src/test/datascience/dataScienceIocContainer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ export class DataScienceIocContainer extends UnitTestIocContainer {
406406
codeRegularExpression: '^(#\\s*%%|#\\s*\\<codecell\\>|#\\s*In\\[\\d*?\\]|#\\s*In\\[ \\])',
407407
markdownRegularExpression: '^(#\\s*%%\\s*\\[markdown\\]|#\\s*\\<markdowncell\\>)',
408408
showJupyterVariableExplorer: true,
409-
variableExplorerExclude: 'module;builtin_function_or_method',
409+
variableExplorerExclude: 'module;function;builtin_function_or_method',
410410
liveShareConnectionTimeout: 100,
411411
autoPreviewNotebooksInInteractivePane: true,
412412
enablePlotViewer: true,

src/test/datascience/editor-integration/codewatcher.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ suite('DataScience Code Watcher Unit Tests', () => {
7979
errorBackgroundColor: '#FFFFFF',
8080
sendSelectionToInteractiveWindow: false,
8181
showJupyterVariableExplorer: true,
82-
variableExplorerExclude: 'module;builtin_function_or_method',
82+
variableExplorerExclude: 'module;function;builtin_function_or_method',
8383
codeRegularExpression: '^(#\\s*%%|#\\s*\\<codecell\\>|#\\s*In\\[\\d*?\\]|#\\s*In\\[ \\])',
8484
markdownRegularExpression: '^(#\\s*%%\\s*\\[markdown\\]|#\\s*\\<markdowncell\\>)',
8585
enableCellCodeLens: true,

src/test/datascience/execution.unit.test.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class MockJupyterServer implements INotebookServer {
8181
throw new Error('Method not implemented');
8282
}
8383

84-
public async getCompletion(_cellCode: string, _offsetInCode: number, _cancelToken?: CancellationToken) : Promise<INotebookCompletion> {
84+
public async getCompletion(_cellCode: string, _offsetInCode: number, _cancelToken?: CancellationToken): Promise<INotebookCompletion> {
8585
throw new Error('Method not implemented');
8686
}
8787
public execute(_code: string, _f: string, _line: number): Promise<ICell[]> {
@@ -113,15 +113,15 @@ class MockJupyterServer implements INotebookServer {
113113
return Promise.resolve();
114114
}
115115

116-
public getSysInfo() : Promise<ICell | undefined> {
116+
public getSysInfo(): Promise<ICell | undefined> {
117117
return Promise.resolve(undefined);
118118
}
119119

120-
public interruptKernel(_timeout: number) : Promise<InterruptResult> {
120+
public interruptKernel(_timeout: number): Promise<InterruptResult> {
121121
throw new Error('Method not implemented');
122122
}
123123

124-
public async dispose() : Promise<void> {
124+
public async dispose(): Promise<void> {
125125
if (this.launchInfo) {
126126
this.launchInfo.connectionInfo.dispose(); // This should kill the process that's running
127127
this.launchInfo = undefined;
@@ -145,7 +145,7 @@ class DisposableRegistry implements IDisposableRegistry, IAsyncDisposableRegistr
145145
this.disposables.push(disposable);
146146
}
147147

148-
public dispose = async () : Promise<void> => {
148+
public dispose = async (): Promise<void> => {
149149
for (const disposable of this.disposables) {
150150
if (!disposable) {
151151
continue;
@@ -235,7 +235,7 @@ suite('Jupyter Execution', async () => {
235235
return cleanupDisposables();
236236
});
237237

238-
function cleanupDisposables() : Promise<void> {
238+
function cleanupDisposables(): Promise<void> {
239239
return disposableRegistry.dispose();
240240
}
241241

@@ -326,9 +326,9 @@ suite('Jupyter Execution', async () => {
326326
.returns(result);
327327
const withModuleArgs = ['-m', module, ...args];
328328
service.setup(x => x.exec(
329-
TypeMoq.It.is(a => argsMatch(withModuleArgs, a)),
330-
TypeMoq.It.isAny()))
331-
.returns(result);
329+
TypeMoq.It.is(a => argsMatch(withModuleArgs, a)),
330+
TypeMoq.It.isAny()))
331+
.returns(result);
332332
}
333333

334334
function setupPythonServiceExecObservable(service: TypeMoq.IMock<IPythonExecutionService>, module: string, args: (string | RegExp)[], stderr: string[], stdout: string[]) {
@@ -548,7 +548,7 @@ suite('Jupyter Execution', async () => {
548548
errorBackgroundColor: '#FFFFFF',
549549
sendSelectionToInteractiveWindow: false,
550550
showJupyterVariableExplorer: true,
551-
variableExplorerExclude: 'module;builtin_function_or_method',
551+
variableExplorerExclude: 'module;function;builtin_function_or_method',
552552
codeRegularExpression: '^(#\\s*%%|#\\s*\\<codecell\\>|#\\s*In\\[\\d*?\\]|#\\s*In\\[ \\])',
553553
markdownRegularExpression: '^(#\\s*%%\\s*\\[markdown\\]|#\\s*\\<markdowncell\\>)',
554554
allowLiveShare: false,
@@ -664,7 +664,7 @@ suite('Jupyter Execution', async () => {
664664
// Force config change and ask again
665665
pythonSettings.datascience.searchForJupyter = false;
666666
const evt = {
667-
affectsConfiguration(_m: string) : boolean {
667+
affectsConfiguration(_m: string): boolean {
668668
return true;
669669
}
670670
};

src/test/datascience/interactiveWindowCommandListener.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ suite('Interactive window command listener', async () => {
146146
errorBackgroundColor: '#FFFFFF',
147147
sendSelectionToInteractiveWindow: false,
148148
showJupyterVariableExplorer: true,
149-
variableExplorerExclude: 'module;builtin_function_or_method',
149+
variableExplorerExclude: 'module;function;builtin_function_or_method',
150150
codeRegularExpression: '^(#\\s*%%|#\\s*\\<codecell\\>|#\\s*In\\[\\d*?\\]|#\\s*In\\[ \\])',
151151
markdownRegularExpression: '^(#\\s*%%\\s*\\[markdown\\]|#\\s*\\<markdowncell\\>)',
152152
autoPreviewNotebooksInInteractivePane: true,

src/test/datascience/interactiveWindowTestHelpers.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ export function defaultDataScienceSettings(): IDataScienceSettings {
317317
errorBackgroundColor: '#FFFFFF',
318318
sendSelectionToInteractiveWindow: false,
319319
showJupyterVariableExplorer: true,
320-
variableExplorerExclude: 'module;builtin_function_or_method',
320+
variableExplorerExclude: 'module;function;builtin_function_or_method',
321321
codeRegularExpression: '^(#\\s*%%|#\\s*\\<codecell\\>|#\\s*In\\[\\d*?\\]|#\\s*In\\[ \\])',
322322
markdownRegularExpression: '^(#\\s*%%\\s*\\[markdown\\]|#\\s*\\<markdowncell\\>)',
323323
enablePlotViewer: true

0 commit comments

Comments
 (0)