Skip to content

Commit

Permalink
try again
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Sep 13, 2022
1 parent 4b4deb0 commit e2ff453
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
9 changes: 2 additions & 7 deletions tests/test_provisioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
7 changes: 1 addition & 6 deletions tests/test_restarter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import json
import os
import sys
from pathlib import Path

import pytest
from jupyter_core import paths
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e2ff453

Please sign in to comment.