(self)
| 1619 | assert_equal(test, [33, 66]) |
| 1620 | |
| 1621 | def test_invalid_converter(self): |
| 1622 | strip_rand = lambda x: float((b'r' in x.lower() and x.split()[-1]) or |
| 1623 | (b'r' not in x.lower() and x.strip() or 0.0)) |
| 1624 | strip_per = lambda x: float((b'%' in x.lower() and x.split()[0]) or |
| 1625 | (b'%' not in x.lower() and x.strip() or 0.0)) |
| 1626 | s = TextIO("D01N01,10/1/2003 ,1 %,R 75,400,600\r\n" |
| 1627 | "L24U05,12/5/2003, 2 %,1,300, 150.5\r\n" |
| 1628 | "D02N03,10/10/2004,R 1,,7,145.55") |
| 1629 | kwargs = dict( |
| 1630 | converters={2: strip_per, 3: strip_rand}, delimiter=",", |
| 1631 | dtype=None) |
| 1632 | assert_raises(ConverterError, np.genfromtxt, s, **kwargs) |
| 1633 | |
| 1634 | def test_tricky_converter_bug1666(self): |
| 1635 | # Test some corner cases |
nothing calls this directly
no test coverage detected