[TIP] coverage.py TypeError

Ned Batchelder ned at nedbatchelder.com
Thu Apr 8 11:11:09 PDT 2010


Jean-Paul, this is very odd, I've never seen this error before.  Could 
you possibly provide a scenario I can run to reproduce it?  Also, we 
should move over to a ticket on bitbucket I just created for this: 
http://bitbucket.org/ned/coveragepy/issue/59/html-report-fails-with-int-object-is

--Ned.

exarkun at twistedmatrix.com wrote:
> Hi all,
>
> Running `coverage html`, I'm running into this exception:
>
> Traceback (most recent call last):
>  File "/srv/bb-master/.local/bin/coverage", line 8, in <module>
>    load_entry_point('coverage==3.3.1', 'console_scripts', 'coverage')()
>  File "/srv/bb-master/.local/lib/python2.5/site- 
> packages/coverage-3.3.1-py2.5-linux-i686.egg/coverage/cmdline.py", 
> line 601, in main
>    status = CoverageScript().command_line(argv)
>  File "/srv/bb-master/.local/lib/python2.5/site- 
> packages/coverage-3.3.1-py2.5-linux-i686.egg/coverage/cmdline.py", 
> line 507, in command_line
>    directory=options.directory, **report_args)
>  File "/srv/bb-master/.local/lib/python2.5/site- 
> packages/coverage-3.3.1-py2.5-linux-i686.egg/coverage/control.py", 
> line 362, in html_report
>    omit_prefixes=self.config.omit_prefixes
>  File "/srv/bb-master/.local/lib/python2.5/site- 
> packages/coverage-3.3.1-py2.5-linux-i686.egg/coverage/html.py", line 
> 48, in report
>    self.index_file()
>  File "/srv/bb-master/.local/lib/python2.5/site- 
> packages/coverage-3.3.1-py2.5-linux-i686.egg/coverage/html.py", line 
> 153, in index_file
>    fhtml.write(index_tmpl.render(locals()))
>  File "/srv/bb-master/.local/lib/python2.5/site- 
> packages/coverage-3.3.1-py2.5-linux-i686.egg/coverage/templite.py", 
> line 103, in render
>    engine.execute(self.ops)
>  File "/srv/bb-master/.local/lib/python2.5/site- 
> packages/coverage-3.3.1-py2.5-linux-i686.egg/coverage/templite.py", 
> line 129, in execute
>    raise new_exc
> TypeError: Couldn't evaluate {{ totals.pc_covered|format_pct }}: 'int' 
> object is unsubscriptable
>
> Anyone know what's wrong?
>
> Jean-Paul
>
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
>



More information about the testing-in-python mailing list