I am using django-jenkins v0.110.0 and coverage v5.2.1 , with Django v3.1. As mentioned in the subject, when I ran:
python manage.py jenkins --enable-coverage
I get this error:
AttributeError: 'Coverage' object has no attribute 'data'
Below is the entire stack traceback:
Traceback (most recent call last):
File "manage.py", line 16, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.8/site-packages/django_jenkins/management/commands/jenkins.py", line 47, in run_from_argv
super(Command, self).run_from_argv(argv)
File "/usr/local/lib/python3.8/site-packages/django/core/management/commands/test.py", line 23, in run_from_argv
super().run_from_argv(argv)
File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 330, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 371, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.8/site-packages/django_jenkins/management/commands/jenkins.py", line 116, in handle
coverage.save(tested_locations, options)
File "/usr/local/lib/python3.8/site-packages/django_jenkins/tasks/with_coverage.py", line 29, in save
self.coverage.stop()
File "/usr/local/lib/python3.8/site-packages/django_jenkins/tasks/with_coverage.py", line 55, in get_morfs
return [filename for filename in coverage.data.measured_files()
AttributeError: 'Coverage' object has no attribute 'data'
Test methods in tests.py were ran properly, and junit.xml was produced under the reports dir. But no coverage reports, definitely, because of this error. Am I missing something here? Should I specify a coverage configuration file (coverage.rc) for it to work? Is it not compatible with python3.8? Other issues?
Any ideas are greatly appreciated. Thanks in advance!