def __init__(self, fd, delim=",", quote="\"", output_dicts=False, trim=True): self.source = repeated.lines(fd) self.delim = delim self.quote = quote self.output_dicts = output_dicts self.trim = trim
def fixture_len(self): with open(testlib.get_fixture_path(self.fixture_name), "r") as fd: return counted.count(repeated.lines(fd))
def __call__(self, path): fd = open(path, "r") # We don't close fd here, because repeated.lines is lazy and will read # on demand. The descriptor will be closed in the repeated value's # destructor. return repeated.lines(fd)