Skip to content

Commit 9657c2e

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/multi-644fead5d1
2 parents f839532 + f3fab83 commit 9657c2e

9 files changed

Lines changed: 65 additions & 69 deletions

File tree

.github/workflows/pr-issue-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: 'Ensure PR has an associated issue'
20-
uses: actions/github-script@v8
20+
uses: actions/github-script@v9
2121
with:
2222
script: |
2323
const labels = context.payload.pull_request.labels.map(label => label.name);

build/test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ flask
1212
fastapi
1313
uvicorn
1414
django
15-
testresources
1615
testscenarios
16+
testtools
1717

1818
# Integrated TensorBoard tests
1919
tensorboard

package-lock.json

Lines changed: 37 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1713,7 +1713,7 @@
17131713
"iconv-lite": "^0.6.3",
17141714
"inversify": "^6.0.2",
17151715
"jsonc-parser": "^3.0.0",
1716-
"lodash": "^4.17.23",
1716+
"lodash": "^4.18.1",
17171717
"minimatch": "^5.1.8",
17181718
"named-js-regexp": "^1.3.3",
17191719
"node-stream-zip": "^1.6.0",
Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,2 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
3-
4-
import os
5-
6-
import testresources
7-
from testscenarios import generate_scenarios
8-
9-
def load_tests(loader, tests, pattern):
10-
this_dir = os.path.dirname(__file__)
11-
mytests = loader.discover(start_dir=this_dir, pattern=pattern)
12-
result = testresources.OptimisingTestSuite()
13-
result.addTests(generate_scenarios(mytests))
14-
result.addTests(generate_scenarios(tests))
15-
return result

python_files/tests/unittestadapter/.data/test_scenarios/tests/test_scene.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
33

4-
from testscenarios import TestWithScenarios
4+
import unittest
5+
6+
from testscenarios import TestWithScenarios, generate_scenarios
7+
8+
9+
def load_tests(loader, standard_tests, pattern): # noqa: ARG001
10+
# Pre-expand ``TestWithScenarios`` scenarios at load time so individual
11+
# scenario-multiplied test IDs (e.g. ``test_operations(add)``) can be
12+
# resolved by ``unittest.TestLoader.loadTestsFromName``. Without this,
13+
# ``TestWithScenarios`` only multiplies scenarios at ``run()`` time and
14+
# loading a specific scenario by name raises ``AttributeError``.
15+
result = unittest.TestSuite()
16+
result.addTests(generate_scenarios(standard_tests))
17+
return result
18+
519

620
class TestMathOperations(TestWithScenarios):
721
scenarios = [
822
('add', {'test_id': 'test_add', 'a': 5, 'b': 3, 'expected': 8}),
923
('subtract', {'test_id': 'test_subtract', 'a': 5, 'b': 3, 'expected': 2}),
10-
('multiply', {'test_id': 'test_multiply', 'a': 5, 'b': 3, 'expected': 15})
24+
('multiply', {'test_id': 'test_multiply', 'a': 5, 'b': 3, 'expected': 15}),
1125
]
1226
a: int = 0
1327
b: int = 0

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ microvenv==2025.0 \
88
--hash=sha256:568155ec18af01c89f270d35d123ab803b09672b480c3702d15fd69e9cc5bd1e \
99
--hash=sha256:8a2568a8390a4ffb5af2f05e7642454e03b887e582d192b6316326974eab5d0f
1010
# via -r requirements.in
11-
packaging==26.0 \
12-
--hash=sha256:00243ae351a257117b6a241061796684b084ed1c516a08c48a3f7e147a9d80b4 \
13-
--hash=sha256:b36f1fef9334a5588b4166f8bcd26a14e521f2b55e6b9de3aaa80d3ff7a37529
11+
packaging==26.1 \
12+
--hash=sha256:5d9c0669c6285e491e0ced2eee587eaf67b670d94a19e94e3984a481aba6802f \
13+
--hash=sha256:f042152b681c4bfac5cae2742a55e103d27ab2ec0f3d88037136b6bfe7c9c5de
1414
# via -r requirements.in
1515
tomli==2.4.1 \
1616
--hash=sha256:01f520d4f53ef97964a240a035ec2a869fe1a37dde002b57ebc4417a27ccd853 \

src/client/interpreter/display/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
IInterpreterService,
2525
IInterpreterStatusbarVisibilityFilter,
2626
} from '../contracts';
27-
import { useEnvExtension } from '../../envExt/api.internal';
27+
import { shouldEnvExtHandleActivation } from '../../envExt/api.internal';
2828

2929
/**
3030
* Based on https://github.com/microsoft/vscode-python/issues/18040#issuecomment-992567670.
@@ -68,7 +68,7 @@ export class InterpreterDisplay implements IInterpreterDisplay, IExtensionSingle
6868
}
6969

7070
public async activate(): Promise<void> {
71-
if (useEnvExtension()) {
71+
if (shouldEnvExtHandleActivation()) {
7272
return;
7373
}
7474
const application = this.serviceContainer.get<IApplicationShell>(IApplicationShell);
@@ -115,7 +115,7 @@ export class InterpreterDisplay implements IInterpreterDisplay, IExtensionSingle
115115
}
116116
}
117117
private async updateDisplay(workspaceFolder?: Uri) {
118-
if (useEnvExtension()) {
118+
if (shouldEnvExtHandleActivation()) {
119119
this.statusBar?.hide();
120120
this.languageStatus?.dispose();
121121
this.languageStatus = undefined;

src/test/interpreters/display.unit.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ suite('Interpreters Display', () => {
5959
let pathUtils: TypeMoq.IMock<IPathUtils>;
6060
let languageStatusItem: TypeMoq.IMock<LanguageStatusItem>;
6161
let traceLogStub: sinon.SinonStub;
62-
let useEnvExtensionStub: sinon.SinonStub;
62+
let shouldEnvExtHandleActivationStub: sinon.SinonStub;
6363
async function createInterpreterDisplay(filters: IInterpreterStatusbarVisibilityFilter[] = []) {
6464
interpreterDisplay = new InterpreterDisplay(serviceContainer.object);
6565
try {
@@ -69,8 +69,8 @@ suite('Interpreters Display', () => {
6969
}
7070

7171
async function setupMocks(useLanguageStatus: boolean) {
72-
useEnvExtensionStub = sinon.stub(extapi, 'useEnvExtension');
73-
useEnvExtensionStub.returns(false);
72+
shouldEnvExtHandleActivationStub = sinon.stub(extapi, 'shouldEnvExtHandleActivation');
73+
shouldEnvExtHandleActivationStub.returns(false);
7474

7575
serviceContainer = TypeMoq.Mock.ofType<IServiceContainer>();
7676
workspaceService = TypeMoq.Mock.ofType<IWorkspaceService>();

0 commit comments

Comments
 (0)