mutmut 2.5.0__tar.gz → 2.5.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mutmut-2.5.0 → mutmut-2.5.1}/AUTHORS.rst +4 -1
- {mutmut-2.5.0 → mutmut-2.5.1}/HISTORY.rst +5 -0
- {mutmut-2.5.0 → mutmut-2.5.1}/PKG-INFO +1 -1
- {mutmut-2.5.0 → mutmut-2.5.1}/mutmut/__init__.py +1 -1
- {mutmut-2.5.0 → mutmut-2.5.1}/mutmut/cache.py +8 -8
- {mutmut-2.5.0 → mutmut-2.5.1}/mutmut.egg-info/PKG-INFO +1 -1
- {mutmut-2.5.0 → mutmut-2.5.1}/tests/test_init.py +13 -0
- {mutmut-2.5.0 → mutmut-2.5.1}/tests/test_main.py +1 -0
- {mutmut-2.5.0 → mutmut-2.5.1}/LICENSE +0 -0
- {mutmut-2.5.0 → mutmut-2.5.1}/MANIFEST.in +0 -0
- {mutmut-2.5.0 → mutmut-2.5.1}/README.rst +0 -0
- {mutmut-2.5.0 → mutmut-2.5.1}/mutmut/__main__.py +0 -0
- {mutmut-2.5.0 → mutmut-2.5.1}/mutmut.egg-info/SOURCES.txt +0 -0
- {mutmut-2.5.0 → mutmut-2.5.1}/mutmut.egg-info/dependency_links.txt +0 -0
- {mutmut-2.5.0 → mutmut-2.5.1}/mutmut.egg-info/entry_points.txt +0 -0
- {mutmut-2.5.0 → mutmut-2.5.1}/mutmut.egg-info/not-zip-safe +0 -0
- {mutmut-2.5.0 → mutmut-2.5.1}/mutmut.egg-info/requires.txt +0 -0
- {mutmut-2.5.0 → mutmut-2.5.1}/mutmut.egg-info/top_level.txt +0 -0
- {mutmut-2.5.0 → mutmut-2.5.1}/requirements.txt +0 -0
- {mutmut-2.5.0 → mutmut-2.5.1}/setup.cfg +0 -0
- {mutmut-2.5.0 → mutmut-2.5.1}/setup.py +0 -0
- {mutmut-2.5.0 → mutmut-2.5.1}/test_requirements.txt +0 -0
- {mutmut-2.5.0 → mutmut-2.5.1}/tests/test_cache.py +0 -0
- {mutmut-2.5.0 → mutmut-2.5.1}/tests/test_mutation.py +0 -0
- {mutmut-2.5.0 → mutmut-2.5.1}/tests/test_mutmut_config_hooks.py +0 -0
|
@@ -36,4 +36,7 @@ Credits
|
|
|
36
36
|
* Christopher J. Brody <chris.brody+brodybits@gmail.com>
|
|
37
37
|
* Century-ss <hgfc7543ggfdch@gmail.com>
|
|
38
38
|
* Michael Champagne <michael.champagne@elapsetech.com>
|
|
39
|
-
*
|
|
39
|
+
* Mihail Butvin <butvin.mihail@yandex.ru>
|
|
40
|
+
* Florian Trudel <florian.trudel@gmx.de>
|
|
41
|
+
* berg2043 <phillipb1991@msn.com>
|
|
42
|
+
* Almaz Ilaletdinov <a.ilaletdinov@yandex.ru>
|
|
@@ -33,7 +33,7 @@ from typing import Callable, Dict, Iterator, List, Optional, Set, Tuple
|
|
|
33
33
|
from parso import parse
|
|
34
34
|
from parso.python.tree import Name, Number, Keyword, FStringStart, FStringEnd
|
|
35
35
|
|
|
36
|
-
__version__ = '2.5.
|
|
36
|
+
__version__ = '2.5.1'
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
if os.getcwd() not in sys.path:
|
|
@@ -12,7 +12,7 @@ from typing import Tuple
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
from junit_xml import TestSuite, TestCase, to_xml_report_string
|
|
15
|
-
from pony.orm import Database, Required, db_session, Set, Optional,
|
|
15
|
+
from pony.orm import Database, Required, db_session, Set, Optional, \
|
|
16
16
|
PrimaryKey, RowNotFound, ERDiagramError, OperationalError
|
|
17
17
|
|
|
18
18
|
from mutmut import MUTANT_STATUSES, BAD_TIMEOUT, OK_SUSPICIOUS, BAD_SURVIVED, SKIPPED, UNTESTED, \
|
|
@@ -180,17 +180,17 @@ def print_result_cache(show_diffs=False, dict_synonyms=None, only_this_file=None
|
|
|
180
180
|
else:
|
|
181
181
|
print(ranges([x.id for x in mutants]))
|
|
182
182
|
|
|
183
|
-
print_stuff('Timed out ⏰',
|
|
184
|
-
print_stuff('Suspicious 🤔',
|
|
185
|
-
print_stuff('Survived 🙁',
|
|
186
|
-
print_stuff('Untested/skipped',
|
|
183
|
+
print_stuff('Timed out ⏰', (x for x in Mutant.select() if x.status == BAD_TIMEOUT))
|
|
184
|
+
print_stuff('Suspicious 🤔', (x for x in Mutant.select() if x.status == OK_SUSPICIOUS))
|
|
185
|
+
print_stuff('Survived 🙁', (x for x in Mutant.select() if x.status == BAD_SURVIVED))
|
|
186
|
+
print_stuff('Untested/skipped', (x for x in Mutant.select() if x.status == UNTESTED or x.status == SKIPPED))
|
|
187
187
|
|
|
188
188
|
|
|
189
189
|
@init_db
|
|
190
190
|
@db_session
|
|
191
191
|
def print_result_ids_cache(desired_status):
|
|
192
192
|
status = MUTANT_STATUSES[desired_status]
|
|
193
|
-
mutant_query =
|
|
193
|
+
mutant_query = (x for x in Mutant.select() if x.status == status)
|
|
194
194
|
print(" ".join(str(mutant.id) for mutant in mutant_query))
|
|
195
195
|
|
|
196
196
|
|
|
@@ -235,7 +235,7 @@ def print_result_cache_junitxml(dict_synonyms, suspicious_policy, untested_polic
|
|
|
235
235
|
@db_session
|
|
236
236
|
def create_junitxml_report(dict_synonyms, suspicious_policy, untested_policy):
|
|
237
237
|
test_cases = []
|
|
238
|
-
mutant_list = list(
|
|
238
|
+
mutant_list = list((x for x in Mutant.select()))
|
|
239
239
|
for filename, mutants in groupby(mutant_list, key=lambda x: x.line.sourcefile.filename):
|
|
240
240
|
for mutant in mutants:
|
|
241
241
|
tc = TestCase("Mutant #{}".format(mutant.id), file=filename, line=mutant.line.line_number + 1, stdout=mutant.line.line)
|
|
@@ -261,7 +261,7 @@ def create_junitxml_report(dict_synonyms, suspicious_policy, untested_policy):
|
|
|
261
261
|
@init_db
|
|
262
262
|
@db_session
|
|
263
263
|
def create_html_report(dict_synonyms, directory):
|
|
264
|
-
mutants = sorted(list(
|
|
264
|
+
mutants = sorted(list((x for x in Mutant.select())), key=lambda x: x.line.sourcefile.filename)
|
|
265
265
|
|
|
266
266
|
os.makedirs(directory, exist_ok=True)
|
|
267
267
|
|
|
@@ -42,10 +42,14 @@ def check_mutants_stub(**kwargs):
|
|
|
42
42
|
with patch('mutmut.run_mutation', run_mutation_stub):
|
|
43
43
|
check_mutants_original(**kwargs)
|
|
44
44
|
|
|
45
|
+
|
|
45
46
|
class ConfigStub:
|
|
46
47
|
hash_of_tests = None
|
|
48
|
+
|
|
49
|
+
|
|
47
50
|
config_stub = ConfigStub()
|
|
48
51
|
|
|
52
|
+
|
|
49
53
|
def test_run_mutation_tests_thread_synchronization(monkeypatch):
|
|
50
54
|
# arrange
|
|
51
55
|
total_mutants = 3
|
|
@@ -80,10 +84,12 @@ def test_run_mutation_tests_thread_synchronization(monkeypatch):
|
|
|
80
84
|
|
|
81
85
|
close_active_queues()
|
|
82
86
|
|
|
87
|
+
|
|
83
88
|
@fixture
|
|
84
89
|
def testpatches_path(testdata: Path):
|
|
85
90
|
return testdata / "test_patches"
|
|
86
91
|
|
|
92
|
+
|
|
87
93
|
def test_read_patch_data_new_empty_file_not_in_the_list(testpatches_path: Path):
|
|
88
94
|
# arrange
|
|
89
95
|
new_empty_file_name = "new_empty_file.txt"
|
|
@@ -95,6 +101,7 @@ def test_read_patch_data_new_empty_file_not_in_the_list(testpatches_path: Path):
|
|
|
95
101
|
# assert
|
|
96
102
|
assert not new_empty_file_name in new_empty_file_changes
|
|
97
103
|
|
|
104
|
+
|
|
98
105
|
def test_read_patch_data_removed_empty_file_not_in_the_list(testpatches_path: Path):
|
|
99
106
|
# arrange
|
|
100
107
|
existing_empty_file_name = "existing_empty_file.txt"
|
|
@@ -106,6 +113,7 @@ def test_read_patch_data_removed_empty_file_not_in_the_list(testpatches_path: Pa
|
|
|
106
113
|
# assert
|
|
107
114
|
assert existing_empty_file_name not in remove_empty_file_changes
|
|
108
115
|
|
|
116
|
+
|
|
109
117
|
def test_read_patch_data_renamed_empty_file_not_in_the_list(testpatches_path: Path):
|
|
110
118
|
# arrange
|
|
111
119
|
renamed_empty_file_name = "renamed_existing_empty_file.txt"
|
|
@@ -117,6 +125,7 @@ def test_read_patch_data_renamed_empty_file_not_in_the_list(testpatches_path: Pa
|
|
|
117
125
|
# assert
|
|
118
126
|
assert renamed_empty_file_name not in renamed_empty_file_changes
|
|
119
127
|
|
|
128
|
+
|
|
120
129
|
def test_read_patch_data_added_line_is_in_the_list(testpatches_path: Path):
|
|
121
130
|
# arrange
|
|
122
131
|
file_name = "existing_file.txt"
|
|
@@ -129,6 +138,7 @@ def test_read_patch_data_added_line_is_in_the_list(testpatches_path: Path):
|
|
|
129
138
|
assert file_name in file_changes
|
|
130
139
|
assert file_changes[file_name] == {3} # line is added between second and third
|
|
131
140
|
|
|
141
|
+
|
|
132
142
|
def test_read_patch_data_edited_line_is_in_the_list(testpatches_path: Path):
|
|
133
143
|
# arrange
|
|
134
144
|
file_name = "existing_file.txt"
|
|
@@ -141,6 +151,7 @@ def test_read_patch_data_edited_line_is_in_the_list(testpatches_path: Path):
|
|
|
141
151
|
assert file_name in file_changes
|
|
142
152
|
assert file_changes[file_name] == {2} # line is added between 2nd and 3rd
|
|
143
153
|
|
|
154
|
+
|
|
144
155
|
def test_read_patch_data_edited_line_in_subfolder_is_in_the_list(testpatches_path: Path):
|
|
145
156
|
# arrange
|
|
146
157
|
file_name = os.path.join("sub", "existing_file.txt") # unix will use "/", windows "\" to join
|
|
@@ -153,6 +164,7 @@ def test_read_patch_data_edited_line_in_subfolder_is_in_the_list(testpatches_pat
|
|
|
153
164
|
assert file_name in file_changes
|
|
154
165
|
assert file_changes[file_name] == {2} # line is added between 2nd and 3rd
|
|
155
166
|
|
|
167
|
+
|
|
156
168
|
def test_read_patch_data_renamed_file_edited_line_is_in_the_list(testpatches_path: Path):
|
|
157
169
|
# arrange
|
|
158
170
|
original_file_name = "existing_file.txt"
|
|
@@ -167,6 +179,7 @@ def test_read_patch_data_renamed_file_edited_line_is_in_the_list(testpatches_pat
|
|
|
167
179
|
assert new_file_name in file_changes
|
|
168
180
|
assert file_changes[new_file_name] == {3} # 3rd line is edited
|
|
169
181
|
|
|
182
|
+
|
|
170
183
|
def test_read_patch_data_mutliple_files(testpatches_path: Path):
|
|
171
184
|
# arrange
|
|
172
185
|
expected_changes = {
|
|
@@ -705,6 +705,7 @@ def test_html_output(surviving_mutants_filesystem):
|
|
|
705
705
|
'<tr><td><a href="foo.py.html">foo.py</a></td><td>2</td><td>0</td><td>0</td><td>0.00</td><td>2</td>'
|
|
706
706
|
'</table></body></html>')
|
|
707
707
|
|
|
708
|
+
|
|
708
709
|
def test_html_custom_output(surviving_mutants_filesystem):
|
|
709
710
|
result = CliRunner().invoke(climain, ['run', '--paths-to-mutate=foo.py', "--test-time-base=15.0"], catch_exceptions=False)
|
|
710
711
|
print(repr(result.output))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|