Skip to content
Closed
Show file tree
Hide file tree
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
12 changes: 4 additions & 8 deletions python_files/unittestadapter/django_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@

def django_discovery_runner(manage_py_path: str, args: List[str]) -> None:
# Attempt a small amount of validation on the manage.py path.
try:
pathlib.Path(manage_py_path)
except Exception as e:
raise VSCodeUnittestError(f"Error running Django, manage.py path is not a valid path: {e}") # noqa: B904
if not pathlib.Path(manage_py_path).exists():
raise VSCodeUnittestError("Error running Django, manage.py path does not exist.")

try:
# Get path to the custom_test_runner.py parent folder, add to sys.path and new environment used for subprocess.
Expand Down Expand Up @@ -61,10 +59,8 @@ def django_discovery_runner(manage_py_path: str, args: List[str]) -> None:

def django_execution_runner(manage_py_path: str, test_ids: List[str], args: List[str]) -> None:
# Attempt a small amount of validation on the manage.py path.
try:
pathlib.Path(manage_py_path)
except Exception as e:
raise VSCodeUnittestError(f"Error running Django, manage.py path is not a valid path: {e}") # noqa: B904
if not pathlib.Path(manage_py_path).exists():
raise VSCodeUnittestError("Error running Django, manage.py path does not exist.")

try:
# Get path to the custom_test_runner.py parent folder, add to sys.path.
Expand Down
9 changes: 1 addition & 8 deletions src/client/extensionInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import { Container } from 'inversify';
import { Disposable, Memento, window } from 'vscode';
import { instance, mock } from 'ts-mockito';
import { registerTypes as platformRegisterTypes } from './common/platform/serviceRegistry';
import { registerTypes as processRegisterTypes } from './common/process/serviceRegistry';
import { registerTypes as commonRegisterTypes } from './common/serviceRegistry';
Expand All @@ -29,7 +28,6 @@ import * as pythonEnvironments from './pythonEnvironments';
import { IDiscoveryAPI } from './pythonEnvironments/base/locator';
import { registerLogger } from './logging';
import { OutputChannelLogger } from './logging/outputChannelLogger';
import { WorkspaceService } from './common/application/workspace';

// The code in this module should do nothing more complex than register
// objects to DI and simple init (e.g. no side effects). That implies
Expand Down Expand Up @@ -57,12 +55,7 @@ export function initializeGlobals(
disposables.push(standardOutputChannel);
disposables.push(registerLogger(new OutputChannelLogger(standardOutputChannel)));

const workspaceService = new WorkspaceService();
const unitTestOutChannel =
workspaceService.isVirtualWorkspace || !workspaceService.isTrusted
? // Do not create any test related output UI when using virtual workspaces.
instance(mock<ITestOutputChannel>())
: window.createOutputChannel(OutputChannelNames.pythonTest);
const unitTestOutChannel = window.createOutputChannel(OutputChannelNames.pythonTest);
disposables.push(unitTestOutChannel);

serviceManager.addSingletonInstance<ILogOutputChannel>(ILogOutputChannel, standardOutputChannel);
Expand Down