question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError when using --use-coverage

See original GitHub issue
pip install pytest pytest-cov mutmut hypothesis

(...)

Installing collected packages: iniconfig, toml, pluggy, more-itertools, py, attrs, pytest, coverage, pytest-cov, glob2, parso, click, pony, junit-xml, mutmut, sortedcontainers, hypothesis
Successfully installed attrs-19.3.0 click-7.1.2 coverage-5.2.1 glob2-0.7 hypothesis-5.23.11 iniconfig-1.0.1 junit-xml-1.8 more-itertools-8.4.0 mutmut-2.0.0 parso-0.8.0 pluggy-0.13.1 pony-0.7.13 py-1.9.0 pytest-6.0.1 pytest-cov-2.10.0 sortedcontainers-2.2.2 toml-0.10.1

pytest --cov=$MODULE tests/

(... pytest does its tests ok...)

mutmut run --paths-to-mutate=$MODULE --tests-dir=tests --use-coverage

- Mutation testing starting -

These are the steps:
1. A full test suite run will be made to make sure we
   can run the tests successfully and we know how long
   it takes (to detect infinite loops for example)
2. Mutants will be generated and checked

Results are stored in .mutmut-cache.
Print found mutants with `mutmut results`.

Legend for output:
🎉 Killed mutants.   The goal is for everything to end up in this bucket.
⏰ Timeout.          Test suite took 10 times as long as the baseline so were killed.
🤔 Suspicious.       Tests took a long time, but not long enough to be fatal.
🙁 Survived.         This means your tests needs to be expanded.
🔇 Skipped.          Skipped.

mutmut cache is out of date, clearing it...
1. Running tests without mutations

⠋ Running...
⠙ Running...
⠹ Running...
⠸ Running...
⠼ Running...
⠴ Running...
⠦ Running...
⠧ Running...
⠇ Running...
⠏ Running...
⠋ Running...
⠙ Running...Done
Traceback (most recent call last):
  File "/usr/local/bin/mutmut", line 8, in <module>
    sys.exit(climain())
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/mutmut/__init__.py", line 847, in wrapper
    f(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/mutmut/__main__.py", line 134, in climain
    sys.exit(main(command, argument, argument2, paths_to_mutate, backup, runner,
  File "/usr/local/lib/python3.8/site-packages/mutmut/__main__.py", line 264, in main
    check_coverage_data_filepaths(coverage_data)
  File "/usr/local/lib/python3.8/site-packages/mutmut/__init__.py", line 929, in check_coverage_data_filepaths
    for filepath in coverage_data._lines:
AttributeError: 'CoverageData' object has no attribute '_lines'

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
boxedcommented, Aug 7, 2020

Nice. I have now rolled a release.

1reaction
atugushevcommented, Aug 7, 2020

@falcorocks

$ pip install git+https://github.com/boxed/mutmut.git
Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: 'Coverage' object has no attribute 'source' #1006
AttributeError : 'Coverage' object has no attribute 'source' #1006 ... thank you for your response . i use coverage version 5.1.
Read more >
django-jenkins - AttributeError: 'Coverage' object has no ...
I found out the django-jenkins uses Coverage and in newest version of coverage the method _harvest_data has changed to get_data but in the ......
Read more >
How to Fix AttributeError in Python - Rollbar
The Python AttributeError is an exception that occurs when an attribute reference or assignment fails. Learn how to fix it.
Read more >
What is Loss of Use Coverage For Home Insurance?
Loss of use coverage can help pay for housing and additional living expenses if your home is damaged by a covered loss. Learn...
Read more >
Python: AttributeError - GeeksforGeeks
Solution for AttributeError. Errors and exceptions in Python can be handled using exception handling i.e. by using try and except in Python.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found