Skip to content

Commit

Permalink
add result class error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
eleanorjboyd committed Oct 18, 2023
1 parent 31305e1 commit 395e366
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions pythonFiles/unittestadapter/django_test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@ class CustomTestRunner(DiscoverRunner):
def get_test_runner_kwargs(self):
print("get_test_runner_kwargs")
kwargs = super().get_test_runner_kwargs()
if kwargs["resultclass"] is not None:
raise ValueError(
"Resultclass already set, cannot use custom test runner design for VS Code compatibility."
)
kwargs["resultclass"] = UnittestTestResult
return kwargs
12 changes: 6 additions & 6 deletions src/client/testing/testController/common/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ export class PythonTestServer implements ITestServer, Disposable {
const isRun = runTestIdPort !== undefined;

// NEEDS TO BE UNCOMMENTED TO GET DJANGO WORKING
if (isRun) {
mutableEnv.DJANGO_TEST_ENABLED = 'true';
mutableEnv.MANAGE_PY_PATH = [options.cwd, 'manage.py'].join('/');
console.log('DJANGO_TEST_ENABLED', mutableEnv.DJANGO_TEST_ENABLED);
console.log('MANAGE_PY_PATH', mutableEnv.MANAGE_PY_PATH);
}
// if (isRun) {
// mutableEnv.DJANGO_TEST_ENABLED = 'true';
// mutableEnv.MANAGE_PY_PATH = [options.cwd, 'manage.py'].join('/');
// console.log('DJANGO_TEST_ENABLED', mutableEnv.DJANGO_TEST_ENABLED);
// console.log('MANAGE_PY_PATH', mutableEnv.MANAGE_PY_PATH);
// }

const spawnOptions: SpawnOptions = {
token: options.token,
Expand Down

0 comments on commit 395e366

Please sign in to comment.