From e2ff453ebec02de56051c995dc9e54fdf6d9314f Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 12 Sep 2022 20:02:54 -0500 Subject: [PATCH] try again --- tests/test_provisioning.py | 9 ++------- tests/test_restarter.py | 7 +------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/tests/test_provisioning.py b/tests/test_provisioning.py index 71a09a570..32c64bdff 100644 --- a/tests/test_provisioning.py +++ b/tests/test_provisioning.py @@ -6,7 +6,6 @@ import os import signal import sys -from pathlib import Path from subprocess import PIPE from typing import Any from typing import Dict @@ -78,7 +77,7 @@ async def wait(self) -> Optional[int]: async def send_signal(self, signum: int) -> None: if self.process: if signum == signal.SIGINT and sys.platform == 'win32': - from ..win_interrupt import send_interrupt + from jupyter_client.win_interrupt import send_interrupt send_interrupt(self.process.win32_interrupt_event) return @@ -229,16 +228,12 @@ def mock_get_provisioner(factory, name) -> EntryPoint: @pytest.fixture def kpf(monkeypatch): """Setup the Kernel Provisioner Factory, mocking the entrypoint fetch calls.""" - parent = Path(__file__).absolute().parent - orig_path = os.environ['PATH'] - os.environ['PATH'] = f'{parent}{os.path.pathsep}{orig_path}' monkeypatch.setattr( KernelProvisionerFactory, '_get_all_provisioners', mock_get_all_provisioners ) monkeypatch.setattr(KernelProvisionerFactory, '_get_provisioner', mock_get_provisioner) factory = KernelProvisionerFactory.instance() - yield factory - os.environ['PATH'] = orig_path + return factory class TestDiscovery: diff --git a/tests/test_restarter.py b/tests/test_restarter.py index 46e63856d..5e9343130 100644 --- a/tests/test_restarter.py +++ b/tests/test_restarter.py @@ -5,7 +5,6 @@ import json import os import sys -from pathlib import Path import pytest from jupyter_core import paths @@ -68,15 +67,11 @@ def transport(request): @pytest.fixture def config(transport): - parent = Path(__file__).absolute().parent - orig_path = os.environ['PATH'] - os.environ['PATH'] = f'{parent}{os.path.pathsep}{orig_path}' c = Config() c.KernelManager.transport = transport if transport == "ipc": c.KernelManager.ip = "test" - yield c - os.environ['PATH'] = orig_path + return c @pytest.fixture