Skip to content

Commit 99cef9e

Browse files
authored
Fix calculating pass rate; skip correctly \n lines (#3695)
Signed-off-by: Anatoly Myachev <[email protected]>
1 parent b89974d commit 99cef9e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

scripts/pass_rate.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,14 @@ def get_deselected(report_path: pathlib.Path, skiplist_dir: pathlib.Path) -> int
8080
if not skiplist_path.exists():
8181
return 0
8282
with skiplist_path.open('r') as f:
83-
# skip empty lines and comments
84-
return len([line for line in f.readlines() if line and not line.startswith('#')])
83+
count = 0
84+
for line in f.readlines():
85+
# `strip` allows to skip lines with only '\n' character
86+
line = line.strip()
87+
# skip empty lines and comments
88+
if line and not line.startswith('#'):
89+
count += 1
90+
return count
8591

8692

8793
def get_warnings(reports_path: pathlib.Path, suite: str) -> List[TestWarning]:

0 commit comments

Comments
 (0)