Skip to content

Commit

Permalink
Merge pull request #5465 from IanMatthewHuff/dev/ianhu/fixPythonVersions
Browse files Browse the repository at this point in the history
Fix Variable Explorer functional tests in python 2.7 3.5
  • Loading branch information
IanMatthewHuff authored Apr 25, 2019
2 parents 7ec5010 + a5af1de commit a215b5d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
1 change: 1 addition & 0 deletions news/2 Fixes/5433.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix python 2.7 and 3.5 variable explorer nightly tests
18 changes: 7 additions & 11 deletions src/test/datascience/variableexplorer.functional.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,9 @@ value = 'hello world'`;

// Test our display of basic types. We render 8 rows by default so only 8 values per test
runMountedTest('Variable explorer - Types A', async (wrapper) => {
const basicCode: string = `import numpy as np
import pandas as pd
myList = [x ** 2 for x in range(0,100000)]
const basicCode: string = `myList = [1, 2, 3]
mySet = set([42])
myDict = {}
for value in myList:
myDict[value] = value / 2`;
myDict = {'a': 1}`;

openVariableExplorer(wrapper);

Expand All @@ -181,14 +177,14 @@ for value in myList:

// Verify that we actually update the variable explorer
// Count here is our main render + a render for each variable row as they come in
await waitForUpdate(wrapper, VariableExplorer, 6);
await waitForUpdate(wrapper, VariableExplorer, 5);

const targetVariables: IJupyterVariable[] = [
{name: 'a', value: '1', supportsDataExplorer: false, type: 'int', size: 54, shape: '', count: 0, truncated: false},
{name: 'myDict', value: '{0: 0.0, 1: 0.5, 4: 2.0, 9: 4.5, 16: 8.0, 25: 12.5, 36: 18.0, 49: 24.5, 64: 32.0, 81: 40.5, 100: 50.0, 121: 60.5, 144: 72.0, 169: 84.5, 196: 98.0, 225: 112.5, 256: 128.0, 289: 144.5, 324: 162.0, 361: ', supportsDataExplorer: true, type: 'dict', size: 54, shape: '', count: 0, truncated: false},
{name: 'myList', value: '[0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1024, 1089, 1156, 1225, 1296, 1369, 1444, 1521, 1600,', supportsDataExplorer: true, type: 'list', size: 54, shape: '', count: 0, truncated: false},
{name: 'mySet', value: '{42}', supportsDataExplorer: true, type: 'set', size: 54, shape: '', count: 0, truncated: false},
{name: 'value', value: '9999800001', supportsDataExplorer: false, type: 'int', size: 54, shape: '', count: 0, truncated: false},
// tslint:disable-next-line:quotemark
{name: 'myDict', value: "{'a': 1}", supportsDataExplorer: true, type: 'dict', size: 54, shape: '', count: 0, truncated: false},
{name: 'myList', value: '[1, 2, 3]', supportsDataExplorer: true, type: 'list', size: 54, shape: '', count: 0, truncated: false},
{name: 'mySet', value: '{42}', supportsDataExplorer: true, type: 'set', size: 54, shape: '', count: 0, truncated: false}
];
verifyVariables(wrapper, targetVariables);
}, () => { return ioc; });
Expand Down

0 comments on commit a215b5d

Please sign in to comment.