Skip to content

Commit 1f5e423

Browse files
authored
Merge pull request #743 from Carreau/nonose
Remove some more dependency on nose/iptest
2 parents 05aa0e8 + fce5040 commit 1f5e423

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

ipykernel/tests/test_kernel.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import sys
1010
import time
1111

12-
import nose.tools as nt
1312
from flaky import flaky
1413
import pytest
1514
from packaging import version
@@ -108,9 +107,10 @@ def test_sys_path_profile_dir():
108107

109108

110109
@flaky(max_runs=3)
111-
@dec.skipif(
112-
sys.platform == 'win32' or (sys.platform == "darwin" and sys.version_info >=(3, 8)),
113-
"subprocess prints fail on Windows and MacOS Python 3.8+"
110+
@pytest.mark.skipif(
111+
sys.platform == "win32"
112+
or (sys.platform == "darwin" and sys.version_info >= (3, 8)),
113+
reason="subprocess prints fail on Windows and MacOS Python 3.8+",
114114
)
115115
def test_subprocess_print():
116116
"""printing from forked mp.Process"""
@@ -130,10 +130,10 @@ def test_subprocess_print():
130130

131131
msg_id, content = execute(kc=kc, code=code)
132132
stdout, stderr = assemble_output(kc.get_iopub_msg)
133-
nt.assert_equal(stdout.count("hello"), np, stdout)
133+
assert stdout.count("hello") == np, stdout
134134
for n in range(np):
135-
nt.assert_equal(stdout.count(str(n)), 1, stdout)
136-
assert stderr == ''
135+
assert stdout.count(str(n)) == 1, stdout
136+
assert stderr == ""
137137
_check_master(kc, expected=True)
138138
_check_master(kc, expected=True, stream="stderr")
139139

@@ -161,9 +161,10 @@ def test_subprocess_noprint():
161161

162162

163163
@flaky(max_runs=3)
164-
@dec.skipif(
165-
sys.platform == 'win32' or (sys.platform == "darwin" and sys.version_info >=(3, 8)),
166-
"subprocess prints fail on Windows and MacOS Python 3.8+"
164+
@pytest.mark.skipif(
165+
sys.platform == "win32"
166+
or (sys.platform == "darwin" and sys.version_info >= (3, 8)),
167+
reason="subprocess prints fail on Windows and MacOS Python 3.8+",
167168
)
168169
def test_subprocess_error():
169170
"""error in mp.Process doesn't crash"""
@@ -236,7 +237,7 @@ def test_smoke_faulthandler():
236237
'if not sys.platform.startswith("win32"):',
237238
' faulthandler.register(signal.SIGTERM)'])
238239
_, reply = execute(code, kc=kc)
239-
nt.assert_equal(reply['status'], 'ok', reply.get('traceback', ''))
240+
assert reply["status"] == "ok", reply.get("traceback", "")
240241

241242

242243
def test_help_output():
@@ -268,7 +269,7 @@ def test_is_complete():
268269
assert reply['content']['status'] == 'complete'
269270

270271

271-
@dec.skipif(sys.platform != 'win32', "only run on Windows")
272+
@pytest.mark.skipif(sys.platform != "win32", reason="only run on Windows")
272273
def test_complete():
273274
with kernel() as kc:
274275
execute('a = 1', kc=kc)
@@ -330,7 +331,10 @@ def test_message_order():
330331
assert reply['parent_header']['msg_id'] == msg_id
331332

332333

333-
@dec.skipif(sys.platform.startswith('linux') or sys.platform.startswith('darwin'))
334+
@pytest.mark.skipif(
335+
sys.platform.startswith("linux") or sys.platform.startswith("darwin"),
336+
reason="test only on windows",
337+
)
334338
def test_unc_paths():
335339
with kernel() as kc, TemporaryDirectory() as td:
336340
drive_file_path = os.path.join(td, 'unc.txt')

0 commit comments

Comments
 (0)