mutmut 3.0.0__tar.gz → 3.0.2__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.
@@ -1,6 +1,19 @@
1
1
  Changelog
2
2
  ---------
3
3
 
4
+ 3.0.2
5
+ ~~~~~
6
+
7
+ * Fixed bad entrypoint definition
8
+
9
+ * Ignore files that can't be parsed by `parso`
10
+
11
+
12
+ 3.0.1
13
+ ~~~~~
14
+
15
+ * Missed a file in distribution, so `browse` command was broken.
16
+
4
17
  3.0.0
5
18
  ~~~~~
6
19
 
@@ -3,3 +3,4 @@ include LICENSE
3
3
  include README.rst
4
4
  include requirements.txt
5
5
  include test_requirements.txt
6
+ include mutmut/result_browser_layout.tcss
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mutmut
3
- Version: 3.0.0
3
+ Version: 3.0.2
4
4
  Summary: mutation testing for Python 3
5
5
  Home-page: https://github.com/boxed/mutmut
6
6
  Author: Anders Hovmöller
@@ -50,6 +50,8 @@ Some highlight features:
50
50
  - Interactive terminal based UI
51
51
  - Parallel and fast execution
52
52
 
53
+ .. image:: browse_screenshot.png
54
+
53
55
 
54
56
  If you want to mutate code outside of functions, you can try using mutmut 2,
55
57
  which has a different execution model than mutmut 3+.
@@ -22,6 +22,8 @@ Some highlight features:
22
22
  - Interactive terminal based UI
23
23
  - Parallel and fast execution
24
24
 
25
+ .. image:: browse_screenshot.png
26
+
25
27
 
26
28
  If you want to mutate code outside of functions, you can try using mutmut 2,
27
29
  which has a different execution model than mutmut 3+.
@@ -4,7 +4,7 @@ from parso.python.tree import (
4
4
  Number,
5
5
  )
6
6
 
7
- __version__ = '3.0.0'
7
+ __version__ = '3.0.2'
8
8
 
9
9
 
10
10
  # We have a global whitelist for constants of the pattern __all__, __version__, etc
@@ -43,7 +43,10 @@ from typing import (
43
43
  )
44
44
 
45
45
  import click
46
- from parso import parse
46
+ from parso import (
47
+ parse,
48
+ ParserSyntaxError,
49
+ )
47
50
  from setproctitle import setproctitle
48
51
 
49
52
  import mutmut
@@ -181,10 +184,10 @@ def _mutmut_trampoline(orig, mutants, *args, **kwargs):
181
184
  import os
182
185
  mutant_under_test = os.environ['MUTANT_UNDER_TEST']
183
186
  if mutant_under_test == 'fail':
184
- from __main__ import MutmutProgrammaticFailException
187
+ from mutmut.__main__ import MutmutProgrammaticFailException
185
188
  raise MutmutProgrammaticFailException('Failed programmatically')
186
189
  elif mutant_under_test == 'stats':
187
- from __main__ import record_trampoline_hit
190
+ from mutmut.__main__ import record_trampoline_hit
188
191
  record_trampoline_hit(orig.__module__ + '.' + orig.__name__)
189
192
  return orig(*args, **kwargs)
190
193
  prefix = orig.__module__ + '.' + orig.__name__ + '__mutmut_'
@@ -239,7 +242,7 @@ def create_mutants_for_file(filename, output_path):
239
242
  source = f.read()
240
243
 
241
244
  with open(output_path, 'w') as out:
242
- mutant_names, hash_by_function_name = write_all_mutants_to_file(out=out, source=source)
245
+ mutant_names, hash_by_function_name = write_all_mutants_to_file(out=out, source=source, filename=filename)
243
246
 
244
247
  # validate no syntax errors of mutants
245
248
  with open(output_path) as f:
@@ -269,13 +272,20 @@ def ensure_ends_with_newline(source):
269
272
  return source
270
273
 
271
274
 
272
- def write_all_mutants_to_file(*, out, source):
275
+ def write_all_mutants_to_file(*, out, source, filename):
273
276
  no_mutate_lines = pragma_no_mutate_lines(source)
274
277
 
275
278
  hash_by_function_name = {}
276
279
  mutant_names = []
277
280
 
278
- for type_, x, name_and_hash, mutant_name in yield_mutants_for_module(parse(ensure_ends_with_newline(source), error_recovery=False), no_mutate_lines):
281
+ try:
282
+ ast = parse(ensure_ends_with_newline(source), error_recovery=False)
283
+ except ParserSyntaxError:
284
+ print(f'Warning: unsupported syntax in {filename}, skipping')
285
+ out.write(source)
286
+ return [], {}
287
+
288
+ for type_, x, name_and_hash, mutant_name in yield_mutants_for_module(ast, no_mutate_lines):
279
289
  out.write(x)
280
290
  if mutant_name:
281
291
  mutant_names.append(mutant_name)
@@ -0,0 +1,26 @@
1
+ Screen {
2
+ layout: vertical;
3
+ }
4
+ .container {
5
+ layout: horizontal;
6
+ height: 50%;
7
+ }
8
+
9
+
10
+ DataTable {
11
+ color: #c0c0c0;
12
+ }
13
+
14
+ DataTable:focus {
15
+ color: white;
16
+ }
17
+
18
+ .datatable--cursor {
19
+ color: black;
20
+ background: white;
21
+ }
22
+
23
+ DataTable:focus .datatable--cursor {
24
+ color: black;
25
+ background: orange;
26
+ }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mutmut
3
- Version: 3.0.0
3
+ Version: 3.0.2
4
4
  Summary: mutation testing for Python 3
5
5
  Home-page: https://github.com/boxed/mutmut
6
6
  Author: Anders Hovmöller
@@ -50,6 +50,8 @@ Some highlight features:
50
50
  - Interactive terminal based UI
51
51
  - Parallel and fast execution
52
52
 
53
+ .. image:: browse_screenshot.png
54
+
53
55
 
54
56
  If you want to mutate code outside of functions, you can try using mutmut 2,
55
57
  which has a different execution model than mutmut 3+.
@@ -11,6 +11,7 @@ test_requirements.txt
11
11
  ./mutmut/__main__.py
12
12
  mutmut/__init__.py
13
13
  mutmut/__main__.py
14
+ mutmut/result_browser_layout.tcss
14
15
  mutmut.egg-info/PKG-INFO
15
16
  mutmut.egg-info/SOURCES.txt
16
17
  mutmut.egg-info/dependency_links.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ mutmut = mutmut.__main__:cli
@@ -117,6 +117,6 @@ setup(
117
117
  'mutmut = mutmut.pytestplugin',
118
118
  ],
119
119
  } if running_inside_tests else {
120
- 'console_scripts': ["mutmut = mutmut.__main__:climain"],
120
+ 'console_scripts': ["mutmut = mutmut.__main__:cli"],
121
121
  },
122
122
  )
@@ -313,7 +313,7 @@ class Foo:
313
313
  """.strip()
314
314
 
315
315
  out = StringIO()
316
- mutant_names, hash_by_function_name = write_all_mutants_to_file(out=out, source=source)
316
+ mutant_names, hash_by_function_name = write_all_mutants_to_file(out=out, source=source, filename='filename')
317
317
  assert len(mutant_names) == 2
318
318
  mutants_source = out.getvalue()
319
319
 
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- mutmut = mutmut.__main__:climain
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes