File tree Expand file tree Collapse file tree 5 files changed +22
-15
lines changed Expand file tree Collapse file tree 5 files changed +22
-15
lines changed Original file line number Diff line number Diff line change 13
13
import time
14
14
from unittest import TestCase
15
15
16
- from ipython_genutils .testing import decorators as dec
17
-
18
16
from traitlets .config .loader import Config
19
17
from jupyter_core import paths
20
18
from jupyter_client import KernelManager
21
19
from ..manager import start_new_kernel
22
- from .utils import test_env
20
+ from .utils import test_env , skip_win32
23
21
24
22
TIMEOUT = 30
25
23
@@ -67,7 +65,7 @@ def test_tcp_lifecycle(self):
67
65
km = self ._get_tcp_km ()
68
66
self ._run_lifecycle (km )
69
67
70
- @dec . skip_win32
68
+ @skip_win32
71
69
def test_ipc_lifecycle (self ):
72
70
km = self ._get_ipc_km ()
73
71
self ._run_lifecycle (km )
@@ -82,8 +80,8 @@ def test_get_connect_info(self):
82
80
'key' , 'signature_scheme' ,
83
81
])
84
82
self .assertEqual (keys , expected )
85
-
86
- @dec . skip_win32
83
+
84
+ @skip_win32
87
85
def test_signal_kernel_subprocesses (self ):
88
86
self ._install_test_kernel ()
89
87
km , kc = start_new_kernel (kernel_name = 'signaltest' )
Original file line number Diff line number Diff line change 13
13
import sys
14
14
import unittest
15
15
16
+ import pytest
17
+
16
18
if str is bytes : # py2
17
19
StringIO = io .BytesIO
18
20
else :
19
21
StringIO = io .StringIO
20
22
21
- from ipython_genutils .testing .decorators import onlyif
22
23
from ipython_genutils .tempdir import TemporaryDirectory
23
24
from jupyter_client import kernelspec
24
25
from jupyter_core import paths
@@ -123,7 +124,9 @@ def test_install_kernel_spec_prefix(self):
123
124
self .ksm .log .removeHandler (handler )
124
125
self .assertNotIn ("may not be found" , captured )
125
126
126
- @onlyif (os .name != 'nt' and not os .access ('/usr/local/share' , os .W_OK ), "needs Unix system without root privileges" )
127
+ @pytest .mark .skipif (
128
+ not (os .name != 'nt' and not os .access ('/usr/local/share' , os .W_OK )),
129
+ reason = "needs Unix system without root privileges" )
127
130
def test_cant_install_kernel_spec (self ):
128
131
with self .assertRaises (OSError ):
129
132
self .ksm .install_kernel_spec (self .installable_kernel ,
Original file line number Diff line number Diff line change 4
4
import time
5
5
from unittest import TestCase
6
6
7
- from ipython_genutils .testing import decorators as dec
8
-
9
7
from traitlets .config .loader import Config
10
8
from ..localinterfaces import localhost
11
9
from jupyter_client import KernelManager
12
10
from jupyter_client .multikernelmanager import MultiKernelManager
11
+ from .utils import skip_win32
13
12
14
13
class TestKernelManager (TestCase ):
15
14
@@ -75,12 +74,12 @@ def test_tcp_cinfo(self):
75
74
km = self ._get_tcp_km ()
76
75
self ._run_cinfo (km , 'tcp' , localhost ())
77
76
78
- @dec . skip_win32
77
+ @skip_win32
79
78
def test_ipc_lifecycle (self ):
80
79
km = self ._get_ipc_km ()
81
80
self ._run_lifecycle (km )
82
81
83
- @dec . skip_win32
82
+ @skip_win32
84
83
def test_ipc_cinfo (self ):
85
84
km = self ._get_ipc_km ()
86
85
self ._run_cinfo (km , 'ipc' , 'test' )
Original file line number Diff line number Diff line change 8
8
import uuid
9
9
from datetime import datetime
10
10
11
+ import pytest
12
+
11
13
import zmq
12
14
13
15
from zmq .tests import BaseZMQTestCase
16
18
from jupyter_client import session as ss
17
19
from jupyter_client import jsonutil
18
20
19
- from ipython_genutils .testing .decorators import skipif , module_not_available
20
21
from ipython_genutils .py3compat import string_types
21
22
22
23
def _bad_packer (obj ):
@@ -286,9 +287,8 @@ def test_datetimes_pickle(self):
286
287
session = ss .Session (packer = 'pickle' )
287
288
self ._datetime_test (session )
288
289
289
- @skipif (module_not_available ('msgpack' ))
290
290
def test_datetimes_msgpack (self ):
291
- import msgpack
291
+ msgpack = pytest . importorskip ( ' msgpack' )
292
292
293
293
session = ss .Session (
294
294
pack = msgpack .packb ,
Original file line number Diff line number Diff line change 3
3
"""
4
4
import os
5
5
pjoin = os .path .join
6
+ import sys
6
7
try :
7
8
from unittest .mock import patch
8
9
except ImportError :
9
10
from mock import patch
10
11
12
+ import pytest
13
+
11
14
from ipython_genutils .tempdir import TemporaryDirectory
12
15
16
+
17
+ skip_win32 = pytest .mark .skipif (sys .platform .startswith ('win' ), reason = "Windows" )
18
+
19
+
13
20
class test_env (object ):
14
21
"""Set Jupyter path variables to a temporary directory
15
22
You can’t perform that action at this time.
0 commit comments