From 5897b6ec7fbd1226cd68a292122cc494e46f6829 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 20 Apr 2022 13:26:20 +0300 Subject: Fix linting issues --- tests/qc/test_parsing.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests/qc/test_parsing.py') diff --git a/tests/qc/test_parsing.py b/tests/qc/test_parsing.py index be13d9b..6c784d5 100644 --- a/tests/qc/test_parsing.py +++ b/tests/qc/test_parsing.py @@ -1,3 +1,4 @@ +"""Test the parsing of the files""" import pytest from quality_control.errors import ParseError @@ -14,8 +15,9 @@ from quality_control.parsing import FileType, parse_file ("tests/test_data/duplicated_headers_no_data_errors.tsv", FileType.STANDARD_ERROR),)) def test_parse_file_fails_with_wrong_filetype_declaration(filepath, filetype, strains): + """Check that parsing fails if the wrong file type is declared""" with pytest.raises(ParseError): - for line in parse_file(filepath, filetype, strains): + for line in parse_file(filepath, filetype, strains): # pylint: disable=[unused-variable] pass @pytest.mark.parametrize( @@ -24,6 +26,7 @@ def test_parse_file_fails_with_wrong_filetype_declaration(filepath, filetype, st ("tests/test_data/average.tsv", FileType.AVERAGE), ("tests/test_data/standarderror.tsv", FileType.STANDARD_ERROR))) def test_parse_file_passes_with_valid_files(filepath, filetype, strains): + """Check that parsing succeeds with valid files""" for line in parse_file(filepath, filetype, strains): assert bool(line) @@ -33,6 +36,7 @@ def test_parse_file_passes_with_valid_files(filepath, filetype, strains): ("tests/test_data/average.tsv", FileType.AVERAGE), ("tests/test_data/standarderror.tsv", FileType.STANDARD_ERROR))) def test_parse_file_works_with_large_files(filepath, filetype, strains): + """Check that parsing succeeds even with large files.""" for line in parse_file(filepath, filetype, strains): assert bool(line) @@ -43,6 +47,7 @@ def test_parse_file_works_with_large_files(filepath, filetype, strains): ("tests/test_data/standarderror_1_error_at_end.tsv", FileType.STANDARD_ERROR), ("tests/test_data/duplicated_headers_no_data_errors.tsv", FileType.AVERAGE))) def test_parse_file_raises_exception_on_error_in_file(filepath, filetype, strains): + "Check that parsing fails if any error is found in a file" with pytest.raises(ParseError): - for line in parse_file(filepath, filetype, strains): + for line in parse_file(filepath, filetype, strains): # pylint: disable=[unused-variable] pass -- cgit v1.2.3