From 1271943d03f85146eb304e8447568d66f89d6e23 Mon Sep 17 00:00:00 2001 From: eleanorjboyd Date: Mon, 28 Oct 2024 13:37:03 -0700 Subject: [PATCH] fixing mocked named pipes --- python_files/unittestadapter/pvsc_utils.py | 2 -- .../pytest/pytestDiscoveryAdapter.unit.test.ts | 9 +-------- .../pytest/pytestExecutionAdapter.unit.test.ts | 9 +-------- .../unittest/testExecutionAdapter.unit.test.ts | 9 +-------- 4 files changed, 3 insertions(+), 26 deletions(-) diff --git a/python_files/unittestadapter/pvsc_utils.py b/python_files/unittestadapter/pvsc_utils.py index da3e21a74954..cba3a2d1f59d 100644 --- a/python_files/unittestadapter/pvsc_utils.py +++ b/python_files/unittestadapter/pvsc_utils.py @@ -18,8 +18,6 @@ from typing_extensions import NotRequired # noqa: E402 -from testing_tools import socket_manager # noqa: E402 - # Types diff --git a/src/test/testing/testController/pytest/pytestDiscoveryAdapter.unit.test.ts b/src/test/testing/testController/pytest/pytestDiscoveryAdapter.unit.test.ts index 87b91f6ae2da..e37cc4e622a5 100644 --- a/src/test/testing/testController/pytest/pytestDiscoveryAdapter.unit.test.ts +++ b/src/test/testing/testController/pytest/pytestDiscoveryAdapter.unit.test.ts @@ -40,14 +40,7 @@ suite('pytest test discovery adapter', () => { mockExtensionRootDir.setup((m) => m.toString()).returns(() => '/mocked/extension/root/dir'); utilsStartDiscoveryNamedPipeStub = sinon.stub(util, 'startDiscoveryNamedPipe'); - utilsStartDiscoveryNamedPipeStub.callsFake(() => - Promise.resolve({ - name: 'discoveryResultPipe-mockName', - dispose: () => { - /* no-op */ - }, - }), - ); + utilsStartDiscoveryNamedPipeStub.callsFake(() => Promise.resolve('discoveryResultPipe-mockName')); // constants expectedPath = path.join('/', 'my', 'test', 'path'); diff --git a/src/test/testing/testController/pytest/pytestExecutionAdapter.unit.test.ts b/src/test/testing/testController/pytest/pytestExecutionAdapter.unit.test.ts index 9e0f0d3d6302..9e9b39e91ce8 100644 --- a/src/test/testing/testController/pytest/pytestExecutionAdapter.unit.test.ts +++ b/src/test/testing/testController/pytest/pytestExecutionAdapter.unit.test.ts @@ -83,14 +83,7 @@ suite('pytest test execution adapter', () => { myTestPath = path.join('/', 'my', 'test', 'path', '/'); utilsStartRunResultNamedPipeStub = sinon.stub(util, 'startRunResultNamedPipe'); - utilsStartRunResultNamedPipeStub.callsFake(() => - Promise.resolve({ - name: 'runResultPipe-mockName', - dispose: () => { - /* no-op */ - }, - }), - ); + utilsStartRunResultNamedPipeStub.callsFake(() => Promise.resolve('runResultPipe-mockName')); }); teardown(() => { sinon.restore(); diff --git a/src/test/testing/testController/unittest/testExecutionAdapter.unit.test.ts b/src/test/testing/testController/unittest/testExecutionAdapter.unit.test.ts index d763cbcdff92..9521c4ab9b79 100644 --- a/src/test/testing/testController/unittest/testExecutionAdapter.unit.test.ts +++ b/src/test/testing/testController/unittest/testExecutionAdapter.unit.test.ts @@ -83,14 +83,7 @@ suite('Unittest test execution adapter', () => { myTestPath = path.join('/', 'my', 'test', 'path', '/'); utilsStartRunResultNamedPipeStub = sinon.stub(util, 'startRunResultNamedPipe'); - utilsStartRunResultNamedPipeStub.callsFake(() => - Promise.resolve({ - name: 'runResultPipe-mockName', - dispose: () => { - /* no-op */ - }, - }), - ); + utilsStartRunResultNamedPipeStub.callsFake(() => Promise.resolve('runResultPipe-mockName')); }); teardown(() => { sinon.restore();