Show More
@@ -17,9 +17,10 b' import math' | |||
|
17 | 17 | import random |
|
18 | 18 | import sys |
|
19 | 19 | |
|
20 | import nose.tools as nt | |
|
21 | 20 | from pathlib import Path |
|
22 | 21 | |
|
22 | import pytest | |
|
23 | ||
|
23 | 24 | from IPython.utils import text |
|
24 | 25 | |
|
25 | 26 | #----------------------------------------------------------------------------- |
@@ -116,8 +117,9 b' def eval_formatter_check(f):' | |||
|
116 | 117 | assert s == ns["u"] |
|
117 | 118 | # This decodes in a platform dependent manner, but it shouldn't error out |
|
118 | 119 | s = f.format("{b}", **ns) |
|
119 | ||
|
120 |
|
|
|
120 | ||
|
121 | pytest.raises(NameError, f.format, "{dne}", **ns) | |
|
122 | ||
|
121 | 123 | |
|
122 | 124 | def eval_formatter_slicing_check(f): |
|
123 | 125 | ns = dict(n=12, pi=math.pi, stuff='hello there', os=os) |
@@ -128,7 +130,7 b' def eval_formatter_slicing_check(f):' | |||
|
128 | 130 | s = f.format("{stuff[::2]}", **ns) |
|
129 | 131 | assert s == ns["stuff"][::2] |
|
130 | 132 | |
|
131 |
|
|
|
133 | pytest.raises(SyntaxError, f.format, "{n:x}", **ns) | |
|
132 | 134 | |
|
133 | 135 | def eval_formatter_no_slicing_check(f): |
|
134 | 136 | ns = dict(n=12, pi=math.pi, stuff='hello there', os=os) |
@@ -194,7 +196,7 b' def test_LSString():' | |||
|
194 | 196 | assert lss.l == ["abc", "def"] |
|
195 | 197 | assert lss.s == "abc def" |
|
196 | 198 | lss = text.LSString(os.getcwd()) |
|
197 |
|
|
|
199 | assert isinstance(lss.p[0], Path) | |
|
198 | 200 | |
|
199 | 201 | def test_SList(): |
|
200 | 202 | sl = text.SList(["a 11", "b 1", "a 2"]) |
General Comments 0
You need to be logged in to leave comments.
Login now