Fails if any wrapped converter fails.
(self)
| 241 | ) |
| 242 | |
| 243 | def test_fail(self): |
| 244 | """ |
| 245 | Fails if any wrapped converter fails. |
| 246 | """ |
| 247 | c = pipe(str, to_bool) |
| 248 | |
| 249 | # First wrapped converter fails: |
| 250 | with pytest.raises(ValueError): |
| 251 | c(33) |
| 252 | |
| 253 | # Last wrapped converter fails: |
| 254 | with pytest.raises(ValueError): |
| 255 | c("33") |
| 256 | |
| 257 | def test_sugar(self): |
| 258 | """ |