From 9af3db25527f554879dd03441661cc6ecf5e3236 Mon Sep 17 00:00:00 2001 From: WiredNerd Date: Sat, 16 Sep 2023 12:36:49 -0500 Subject: [PATCH] fix: Sort Mutant List by Filename when building HTML output --- mutmut/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mutmut/cache.py b/mutmut/cache.py index 0bbb3b81..03c1cf39 100644 --- a/mutmut/cache.py +++ b/mutmut/cache.py @@ -261,7 +261,7 @@ def create_junitxml_report(dict_synonyms, suspicious_policy, untested_policy): @init_db @db_session def create_html_report(dict_synonyms): - mutants = list(select(x for x in Mutant)) + mutants = sorted(list(select(x for x in Mutant)), key=lambda x: x.line.sourcefile.filename) os.makedirs('html', exist_ok=True)