Skip to content

Speed up the before all hook for debugger tests #9877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions src/test/testing/debugger.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,16 @@ const defaultUnitTestArgs = ['-v', '-s', '.', '-p', '*test*.py'];
suite('Unit Tests - debugging', () => {
let ioc: UnitTestIocContainer;
const configTarget = IS_MULTI_ROOT_TEST ? ConfigurationTarget.WorkspaceFolder : ConfigurationTarget.Workspace;
suiteSetup(async () => {
// Test disvovery is where the delay is, hence give 10 seconds (as we discover tests at least twice in each test).
suiteSetup(async function() {
// tslint:disable-next-line:no-invalid-this
this.timeout(TEST_TIMEOUT * 2);
// Test discovery is where the delay is, hence give 10 seconds (as we discover tests at least twice in each test).
await initialize();
await updateSetting('testing.unittestArgs', defaultUnitTestArgs, rootWorkspaceUri, configTarget);
await updateSetting('testing.nosetestArgs', [], rootWorkspaceUri, configTarget);
await updateSetting('testing.pytestArgs', [], rootWorkspaceUri, configTarget);
await Promise.all([
updateSetting('testing.unittestArgs', defaultUnitTestArgs, rootWorkspaceUri, configTarget),
updateSetting('testing.nosetestArgs', [], rootWorkspaceUri, configTarget),
updateSetting('testing.pytestArgs', [], rootWorkspaceUri, configTarget)
]);
});
setup(async function() {
// tslint:disable-next-line:no-invalid-this
Expand All @@ -51,9 +55,11 @@ suite('Unit Tests - debugging', () => {
});
teardown(async () => {
await ioc.dispose();
await updateSetting('testing.unittestArgs', defaultUnitTestArgs, rootWorkspaceUri, configTarget);
await updateSetting('testing.nosetestArgs', [], rootWorkspaceUri, configTarget);
await updateSetting('testing.pytestArgs', [], rootWorkspaceUri, configTarget);
await Promise.all([
updateSetting('testing.unittestArgs', defaultUnitTestArgs, rootWorkspaceUri, configTarget),
updateSetting('testing.nosetestArgs', [], rootWorkspaceUri, configTarget),
updateSetting('testing.pytestArgs', [], rootWorkspaceUri, configTarget)
]);
});

function initializeDI() {
Expand Down