(f)
| 57 | |
| 58 | |
| 59 | def eval_formatter_slicing_check(f): |
| 60 | ns = dict(n=12, pi=math.pi, stuff="hello there", os=os) |
| 61 | s = f.format(" {stuff.split()[:]} ", **ns) |
| 62 | assert s == " ['hello', 'there'] " |
| 63 | s = f.format(" {stuff.split()[::-1]} ", **ns) |
| 64 | assert s == " ['there', 'hello'] " |
| 65 | s = f.format("{stuff[::2]}", **ns) |
| 66 | assert s == ns["stuff"][::2] |
| 67 | |
| 68 | pytest.raises(SyntaxError, f.format, "{n:x}", **ns) |
| 69 | |
| 70 | |
| 71 | def eval_formatter_no_slicing_check(f): |
no test coverage detected
searching dependent graphs…