Skip to content

Commit

Permalink
suppress unrelated warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Sep 15, 2024
1 parent 384c231 commit 6102263
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import bz2
import gzip
import os
import warnings
from pathlib import Path

import pytest
Expand Down Expand Up @@ -167,9 +168,6 @@ def test_big_file(self, l_end):
for idx, line in enumerate(reverse_readline(file, max_mem=4096)):
assert line == f"{str(num_lines - idx)}{l_end}"

def test_blk_size(self):
"""TODO: test different block sizes."""

def test_read_bz2(self):
"""
Make sure a file containing line numbers is read in reverse order,
Expand Down Expand Up @@ -197,6 +195,10 @@ def test_read_file_with_empty_lines(self, l_end, ram):
"""Empty lines should not be skipped.
Using a very small RAM size to force non in-RAM mode.
"""
warnings.filterwarnings(
"ignore", message="max_mem=4 smaller than blk_size=4096"
)

contents = (f"line1{l_end}", f"{l_end}", f"line3{l_end}")
filename = "test_empty_line.txt"

Expand Down Expand Up @@ -234,6 +236,10 @@ def test_read_file_with_empty_lines(self, l_end, ram):
@pytest.mark.parametrize("l_end", ["\n", "\r\n"])
def test_different_line_endings(self, l_end, ram):
"""Using a very small RAM size to force non in-RAM mode."""
warnings.filterwarnings(
"ignore", message="max_mem=4 smaller than blk_size=4096"
)

contents = (f"Line1{l_end}", f"Line2{l_end}", f"Line3{l_end}")
file_name = "test_file.txt"

Expand Down

0 comments on commit 6102263

Please sign in to comment.