Skip to content
Open
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
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ jobs:
if: matrix.test-suite == 'venv'
run: |
python -m pip install virtualenv
python -m virtualenv .virtualenv/
python -m virtualenv --no-venv-redirect .virtualenv/
if ('${{ matrix.os }}' -match 'windows-latest') {
& ".virtualenv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} virtualEnvPath
} else {
Expand All @@ -326,10 +326,11 @@ jobs:
if: matrix.test-suite == 'venv' && startsWith(matrix.python, 3.)
run: |
python -m venv .venv
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
if ('${{ matrix.os }}' -match 'windows-latest') {
& ".venv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath
& "./.venv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath
} else {
& ".venv/bin/python" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath
& "./.venv/bin/python" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath
}

- name: Prepare conda for venv tests
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ jobs:
if: matrix.test-suite == 'venv'
run: |
python -m pip install virtualenv
python -m virtualenv .virtualenv/
python -m virtualenv --no-venv-redirect .virtualenv/
if ('${{ matrix.os }}' -match 'windows-latest') {
& ".virtualenv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} virtualEnvPath
} else {
Expand All @@ -319,10 +319,11 @@ jobs:
if: matrix.test-suite == 'venv' && startsWith(matrix.python, 3.)
run: |
python -m venv .venv
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
if ('${{ matrix.os }}' -match 'windows-latest') {
& ".venv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath
& "./.venv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath
} else {
& ".venv/bin/python" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath
& "./.venv/bin/python" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath
}

- name: Prepare conda for venv tests
Expand Down Expand Up @@ -584,7 +585,7 @@ jobs:
shell: pwsh
run: |
python -m pip install virtualenv
python -m virtualenv .virtualenv/
python -m virtualenv --no-venv-redirect .virtualenv/
if ('${{ matrix.os }}' -match 'windows-latest') {
& ".virtualenv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} virtualEnvPath
} else {
Expand All @@ -598,10 +599,11 @@ jobs:
shell: pwsh
run: |
python -m venv .venv
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
if ('${{ matrix.os }}' -match 'windows-latest') {
& ".venv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath
& "./.venv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath
} else {
& ".venv/bin/python" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath
& "./.venv/bin/python" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath
}

- name: Prepare conda for venv tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ class NativePythonFinderImpl extends DisposableBase implements NativePythonFinde
? getGlobalStorage<boolean>(this.context, DONT_SHOW_SPAWN_ERROR_AGAIN, false)
: ({ get: () => false, set: async () => {} } as IPersistentStorage<boolean>);
this.connection = this.start();
void this.configure();
this.firstRefreshResults = this.refreshFirstTime();
}

Expand Down
5 changes: 3 additions & 2 deletions src/test/pythonEnvironments/nativePythonFinder.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ suite('Native Python Finder', () => {
let getConfigurationStub: sinon.SinonStub;
let configMock: typemoq.IMock<WorkspaceConfiguration>;
let getWorkspaceFolderPathsStub: sinon.SinonStub;
const locatorOutput = new MockOutputChannel('locator');

setup(() => {
createLogOutputChannelStub = sinon.stub(windowsApis, 'createLogOutputChannel');
createLogOutputChannelStub.returns(new MockOutputChannel('locator'));
createLogOutputChannelStub.returns(locatorOutput);

getWorkspaceFolderPathsStub = sinon.stub(workspaceApis, 'getWorkspaceFolderPaths');
getWorkspaceFolderPathsStub.returns([]);
Expand Down Expand Up @@ -55,7 +56,7 @@ suite('Native Python Finder', () => {
}

// typically all test envs should have at least one environment
assert.isNotEmpty(envs);
assert.isNotEmpty(envs, `Python Locator output:\n${locatorOutput.output || '(none)'}`);
});

test('Resolve should return python environments with version', async () => {
Expand Down
Loading