1717import random
1818import sys
1919
20- import nose .tools as nt
2120from pathlib import Path
2221
22+ import pytest
23+
2324from 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
122124def 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
133135def 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
199201def test_SList ():
200202 sl = text .SList (["a 11" , "b 1" , "a 2" ])
0 commit comments