Skip to content

Commit b42824d

Browse files
committed
.
1 parent a732ffb commit b42824d

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

mutmut/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
_stats = set()
1111
tests_by_mangled_function_name = defaultdict(set)
1212

13+
1314
def _reset_globals():
1415
global duration_by_test, stats_time, config, _stats, tests_by_mangled_function_name
1516

1617
duration_by_test = {}
1718
stats_time = None
1819
config = None
1920
_stats = set()
20-
tests_by_mangled_function_name = defaultdict(set)
21+
tests_by_mangled_function_name = defaultdict(set)

mutmut/__main__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ def calculate_summary_stats(source_file_mutation_data_by_path):
545545
suspicious=sum(x.suspicious for x in stats),
546546
timeout=sum(x.timeout for x in stats),
547547
check_was_interrupted_by_user=sum(x.check_was_interrupted_by_user for x in stats),
548+
segfault=sum(x.segfault for x in stats),
548549
)
549550

550551

@@ -677,6 +678,7 @@ def ensure_config_loaded():
677678
if mutmut.config is None:
678679
mutmut.config = load_config()
679680

681+
680682
def load_config():
681683
s = config_reader()
682684

tests/e2e/test_e2e_result_snapshots.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def change_cwd(path):
1717
finally:
1818
os.chdir(old_cwd)
1919

20+
2021
def read_all_stats_for_project(project_path: Path) -> dict[str, dict]:
2122
"""Create a single dict from all mutant results in *.meta files"""
2223
with change_cwd(project_path):
@@ -32,14 +33,17 @@ def read_all_stats_for_project(project_path: Path) -> dict[str, dict]:
3233

3334
return stats
3435

36+
3537
def read_json_file(path: Path):
3638
with open(path, 'r') as file:
3739
return json.load(file)
3840

41+
3942
def write_json_file(path: Path, data: Any):
4043
with open(path, 'w') as file:
4144
json.dump(data, file, indent=2)
4245

46+
4347
def asserts_results_did_not_change(project: str):
4448
"""Runs mutmut on this project and verifies that the results stay the same for all mutations."""
4549
project_path = Path("..").parent / "e2e_projects" / project
@@ -66,11 +70,11 @@ def asserts_results_did_not_change(project: str):
6670
write_json_file(snapshot_path, results)
6771

6872

69-
7073
def test_my_lib_result_snapshot():
7174
mutmut._reset_globals()
7275
asserts_results_did_not_change("my_lib")
7376

77+
7478
def test_config_result_snapshot():
7579
mutmut._reset_globals()
76-
asserts_results_did_not_change("config")
80+
asserts_results_did_not_change("config")

0 commit comments

Comments
 (0)