Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 45fe9d8

Browse files
committed
[utils][tests][text] Remove nose
1 parent 8be458e commit 45fe9d8

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

IPython/utils/tests/test_text.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
import random
1818
import sys
1919

20-
import nose.tools as nt
2120
from pathlib import Path
2221

22+
import pytest
23+
2324
from IPython.utils import text
2425

2526
#-----------------------------------------------------------------------------
@@ -116,8 +117,9 @@ def eval_formatter_check(f):
116117
assert s == ns["u"]
117118
# This decodes in a platform dependent manner, but it shouldn't error out
118119
s = f.format("{b}", **ns)
119-
120-
nt.assert_raises(NameError, f.format, '{dne}', **ns)
120+
121+
pytest.raises(NameError, f.format, "{dne}", **ns)
122+
121123

122124
def eval_formatter_slicing_check(f):
123125
ns = dict(n=12, pi=math.pi, stuff='hello there', os=os)
@@ -128,7 +130,7 @@ def eval_formatter_slicing_check(f):
128130
s = f.format("{stuff[::2]}", **ns)
129131
assert s == ns["stuff"][::2]
130132

131-
nt.assert_raises(SyntaxError, f.format, "{n:x}", **ns)
133+
pytest.raises(SyntaxError, f.format, "{n:x}", **ns)
132134

133135
def eval_formatter_no_slicing_check(f):
134136
ns = dict(n=12, pi=math.pi, stuff='hello there', os=os)
@@ -194,7 +196,7 @@ def test_LSString():
194196
assert lss.l == ["abc", "def"]
195197
assert lss.s == "abc def"
196198
lss = text.LSString(os.getcwd())
197-
nt.assert_is_instance(lss.p[0], Path)
199+
assert isinstance(lss.p[0], Path)
198200

199201
def test_SList():
200202
sl = text.SList(["a 11", "b 1", "a 2"])

0 commit comments

Comments
 (0)