sixty-north / cosmic-ray

Mutation testing for Python
MIT License
565 stars 57 forks source link

cr-html fails for unfinished sessions #492

Closed tomato42 closed 3 years ago

tomato42 commented 4 years ago

when the session has not completed (cosmic-ray exec didn't finish), running cr-html fails:

Traceback (most recent call last):
  File "./cosmic-ray-venv/bin/cr-html", line 11, in <module>
    load_entry_point('cosmic-ray==5.6.2', 'console_scripts', 'cr-html')()
  File "/home/tomato/workspace/python-ecdsa/cosmic-ray-venv/lib/python3.7/site-packages/cosmic_ray-5.6.2-py3.7.egg/cosmic_ray/tools/html.py", line 26, in report_html
    arguments['--skip-success'])
  File "/home/tomato/workspace/python-ecdsa/cosmic-ray-venv/lib/python3.7/site-packages/cosmic_ray-5.6.2-py3.7.egg/cosmic_ray/tools/html.py", line 168, in _generate_html_report
    if not result.is_killed:
AttributeError: 'NoneType' object has no attribute 'is_killed'
abingham commented 4 years ago

We're just missing a guard around code like that; incomplete work-items won't have a result. Honestly, looking at that file, it could use some cleanup, maybe some refactoring to make it more clear where results are needed and where just the work-item is needed.