def test_read_multi_with_splitter_and_mapper(tmp_path): file = tmp_path / "in" file.write_text('12345,-1,-2\n6789,-3,-4\n') result = reader.read_multi(file, splitter=',', mapper=int) assert_that(result).is_equal_to([[12345, -1, -2], [6789, -3, -4]])
def test_read_multi_with_splitter(tmp_path): file = tmp_path / "in" file.write_text('12345,abc\n6789,def\n') result = reader.read_multi(file, splitter=',') assert_that(result).is_equal_to([['12345', 'abc'], ['6789', 'def']])
def test_read_multi(tmp_path): file = tmp_path / "in" file.write_text('12345\n6789\n') result = reader.read_multi(file) assert_that(result).is_equal_to(['12345', '6789'])
def read(filename='in'): return read_multi(__file__, filename, splitter=')')
def read(filename='in'): return read_multi(__file__, filename, splitter='x', mapper=int)
def read(filename='in'): return read_multi(__file__, filename, mapper=list)