Skip to content

Commit 11c59d1

Browse files
committed
e2e test for when mutate_only_covered_lines = true
1 parent 7eec1cd commit 11c59d1

File tree

6 files changed

+48
-0
lines changed

6 files changed

+48
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This project will be E2E tested. It is used to test the mutate_only_covered_lines feature of mutmut.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[project]
2+
name = "mutate_only_covered_lines"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
authors = []
7+
requires-python = ">=3.10"
8+
dependencies = []
9+
10+
[build-system]
11+
requires = ["hatchling"]
12+
build-backend = "hatchling.build"
13+
14+
[dependency-groups]
15+
dev = [
16+
"pytest>=8.3.5",
17+
]
18+
19+
[tool.mutmut]
20+
debug = true
21+
mutate_only_covered_lines = true
22+
23+
[tool.pytest]
24+
asyncio_default_fixture_loop_scope = "function"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
def hello_mutate_only_covered_lines(simple_branch: bool) -> str:
2+
if simple_branch:
3+
return "Hello from mutate_only_covered_lines! (true)"
4+
else:
5+
return "Hello from mutate_only_covered_lines! (false)"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from mutate_only_covered_lines import hello_mutate_only_covered_lines
2+
3+
"""This tests the mutate_only_covered_lines feature."""
4+
5+
def test_mutate_only_covered_lines():
6+
assert hello_mutate_only_covered_lines(True) == "Hello from mutate_only_covered_lines! (true)"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"mutants/src/mutate_only_covered_lines/__init__.py.meta": {
3+
"mutate_only_covered_lines.x_hello_mutate_only_covered_lines__mutmut_1": 1,
4+
"mutate_only_covered_lines.x_hello_mutate_only_covered_lines__mutmut_2": 1,
5+
"mutate_only_covered_lines.x_hello_mutate_only_covered_lines__mutmut_3": 1
6+
}
7+
}

tests/e2e/test_e2e_result_snapshots.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,8 @@ def test_my_lib_result_snapshot():
7979
def test_config_result_snapshot():
8080
mutmut._reset_globals()
8181
asserts_results_did_not_change("config")
82+
83+
84+
def test_mutate_only_covered_lines_result_snapshot():
85+
mutmut._reset_globals()
86+
asserts_results_did_not_change("mutate_only_covered_lines")

0 commit comments

Comments
 (0)