Skip to content

Commit 1345d61

Browse files
committed
refine messaging etc
1 parent 01210fd commit 1345d61

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/client/testing/configuration/pytest/testConfigurationManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export class ConfigurationManager extends TestConfigurationManager {
4949
args.push(testDir);
5050
}
5151
const installed = await this.installer.isInstalled(Product.pytest);
52+
await this.testConfigSettingsService.updateTestArgs(wkspace.fsPath, Product.pytest, args);
5253
if (!installed) {
5354
// Check if Python Environments extension is available for enhanced installation flow
5455
if (this.pytestInstallationHelper.isEnvExtensionAvailable()) {
@@ -64,7 +65,6 @@ export class ConfigurationManager extends TestConfigurationManager {
6465
await this.installer.install(Product.pytest);
6566
}
6667
}
67-
await this.testConfigSettingsService.updateTestArgs(wkspace.fsPath, Product.pytest, args);
6868
}
6969

7070
private async getConfigFiles(rootDir: string): Promise<string[]> {

src/client/testing/configuration/pytestInstallationHelper.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ export class PytestInstallationHelper {
4444
return this.installPytestWithEnvExtension(workspaceUri);
4545
} else {
4646
// Fall back to traditional installer if environments extension is not available
47-
traceInfo('Python Environments extension not available, installation cannot proceed via environment extension');
47+
traceInfo(
48+
'Python Environments extension not available, installation cannot proceed via environment extension',
49+
);
4850
return false;
4951
}
5052
} catch (error) {
@@ -66,7 +68,7 @@ export class PytestInstallationHelper {
6668
if (!environment) {
6769
traceError('No Python environment found for workspace:', workspaceUri.fsPath);
6870
await this.appShell.showErrorMessage(
69-
l10n.t('No Python environment found. Please set up a Python environment first.')
71+
l10n.t('No Python environment found. Please set up a Python environment first.'),
7072
);
7173
return false;
7274
}
@@ -77,13 +79,9 @@ export class PytestInstallationHelper {
7779
});
7880

7981
traceInfo('pytest installation completed successfully');
80-
await this.appShell.showInformationMessage(l10n.t('pytest has been installed successfully.'));
8182
return true;
8283
} catch (error) {
8384
traceError('Failed to install pytest using Python Environments extension:', error);
84-
await this.appShell.showErrorMessage(
85-
l10n.t('Failed to install pytest. Please install it manually or check your Python environment.')
86-
);
8785
return false;
8886
}
8987
}
@@ -95,4 +93,4 @@ export class PytestInstallationHelper {
9593
isEnvExtensionAvailable(): boolean {
9694
return useEnvExtension();
9795
}
98-
}
96+
}

0 commit comments

Comments
 (0)