From d99bfe599e4bf25d3dc5f2417210a83958e82dad Mon Sep 17 00:00:00 2001 From: Tobias Ribizel Date: Wed, 26 Oct 2022 09:59:36 +0000 Subject: [PATCH] fix python test --- python/cudf/cudf/tests/test_text.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/python/cudf/cudf/tests/test_text.py b/python/cudf/cudf/tests/test_text.py index 2c5c96781fe..627bf0a68bb 100644 --- a/python/cudf/cudf/tests/test_text.py +++ b/python/cudf/cudf/tests/test_text.py @@ -827,14 +827,20 @@ def test_read_text_byte_range(datadir): def test_read_text_byte_range_large(tmpdir): - content = str([["\n" if x % 5 == 0 else "x"] for x in range(0, 3000)]) - delimiter = "1." + content = "".join(("\n" if x % 5 == 4 else "x") for x in range(0, 3000)) + delimiter = "\n" temp_file = str(tmpdir) + "/temp.txt" with open(temp_file, "w") as f: f.write(content) - cudf.read_text(temp_file, delimiter=delimiter) + expected = cudf.Series(["xxxx\n" for i in range(0, 200)]) + + actual = cudf.read_text( + temp_file, delimiter=delimiter, byte_range=[1000, 1000] + ) + + assert_eq(expected, actual) def test_read_text_in_memory(datadir):