@@ -30,8 +30,8 @@ def make_comparison(easyhla: EasyHLA, ref_seq: str, test_seq: str) -> str:
3030 side_is_short = "test"
3131 elif len (ref ) < len (test ):
3232 side_is_short = "ref"
33- return easyhla .bin2nuc (masked_seq ) + f" [{ side_is_short } is short]"
34- return easyhla .bin2nuc (masked_seq )
33+ return easyhla .bin2nuc (masked_seq ) + f" [{ side_is_short } is short]" # type: ignore
34+ return easyhla .bin2nuc (masked_seq ) # type: ignore
3535
3636
3737def compare_ref_vs_test (
@@ -60,9 +60,9 @@ def compare_ref_vs_test(
6060
6161 column_names = reference_file [0 ].strip ().split ("," )
6262
63- assert len (reference_file ) == len (
64- test_output_file
65- ), "Size of test output does not match reference file!"
63+ assert len (reference_file ) == len (test_output_file ), (
64+ "Size of test output does not match reference file!"
65+ )
6666
6767 for row_num , (ref , test ) in enumerate (zip (reference_file , test_output_file )):
6868 try :
@@ -86,19 +86,19 @@ def compare_ref_vs_test(
8686
8787 _row_num = row_num + 1 + int (skip_preamble [1 ])
8888 # Check that there is no strippable whitespace when there shouldn't be.
89- assert (
90- _test == _test . strip ()
91- ), f"Whitespace detected at row { _row_num } , column { col_num } (' { column_names [ col_num ] } ')"
92- assert (
93- _ref == _ref . strip ()
94- ), f"[REFERENCE FILE] Whitespace detected at row { _row_num } , column { col_num } (' { column_names [ col_num ] } ')"
95-
96- assert len (_ref .strip ()) == len (
97- _test . strip ()
98- ), f"Length mismatch detected at row { _row_num } , column { col_num } (' { column_names [ col_num ] } ')"
99- assert (
100- _ref . strip () == _test . strip ()
101- ), f"Content mismatch detected at row { _row_num } , column { col_num } (' { column_names [ col_num ] } ')"
89+ assert _test == _test . strip (), (
90+ f"Whitespace detected at row { _row_num } , column { col_num } (' { column_names [ col_num ] } ')"
91+ )
92+ assert _ref == _ref . strip (), (
93+ f"[REFERENCE FILE] Whitespace detected at row { _row_num } , column { col_num } (' { column_names [ col_num ] } ')"
94+ )
95+
96+ assert len (_ref .strip ()) == len (_test . strip ()), (
97+ f"Length mismatch detected at row { _row_num } , column { col_num } (' { column_names [ col_num ] } ')"
98+ )
99+ assert _ref . strip () == _test . strip (), (
100+ f"Content mismatch detected at row { _row_num } , column { col_num } (' { column_names [ col_num ] } ')"
101+ )
102102
103103 if row_num > 0 and column_names [col_num ] in [
104104 "ALLELES_CLEAN" ,
@@ -107,7 +107,9 @@ def compare_ref_vs_test(
107107 assert (
108108 set (_ref .strip ().split (";" )) ^ set (_test .strip ().split (";" ))
109109 == set ()
110- ), f"Order mismatch detected at row { _row_num } , column { col_num } ('{ column_names [col_num ]} ')"
110+ ), (
111+ f"Order mismatch detected at row { _row_num } , column { col_num } ('{ column_names [col_num ]} ')"
112+ )
111113 except AssertionError as e :
112114 print ("REF >>>" , ref )
113115 print ("OUT >>>" , test )
0 commit comments