Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception generated with -f json and -f yaml #170

Open
ligurio opened this issue Aug 7, 2023 · 0 comments
Open

Exception generated with -f json and -f yaml #170

ligurio opened this issue Aug 7, 2023 · 0 comments

Comments

@ligurio
Copy link

ligurio commented Aug 7, 2023

Everything is ok with -f text:

$ pycobertura diff --format text -s1 . -s2 . build1/coverage/luajit.xml build8/coverage/luajit.xml 
Filename             Stmts    Miss  Cover    Missing
-----------------  -------  ------  -------  ---------
src/lj_crecord.c         0      -9  +0.78%
src/lj_gc.c              0      -1  +0.20%
src/lj_opt_fold.c        0      -8  +0.73%
src/lj_opt_mem.c         0      -9  +1.63%
src/lj_record.c          0      -2  +0.14%
src/lj_str.c             0      -7  +4.29%
TOTAL                    0     -36  +0.15%

but failed, with -f json and -f yaml:

$ pycobertura diff --format yaml -s1 . -s2 . build1/coverage/luajit.xml build8/coverage/luajit.xml 
Traceback (most recent call last):
  File "/home/sergeyb/.local/bin/pycobertura", line 8, in <module>
    sys.exit(pycobertura())
  File "/home/sergeyb/.local/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/sergeyb/.local/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/sergeyb/.local/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/sergeyb/.local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/sergeyb/.local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/sergeyb/.local/lib/python3.10/site-packages/pycobertura/cli.py", line 326, in diff
    report = reporter.generate()
  File "/home/sergeyb/.local/lib/python3.10/site-packages/pycobertura/reporters.py", line 399, in generate
    stats_dict = self.per_file_stats(lines)
  File "/home/sergeyb/.local/lib/python3.10/site-packages/pycobertura/reporters.py", line 291, in per_file_stats
    file_stats_list = [
  File "/home/sergeyb/.local/lib/python3.10/site-packages/pycobertura/reporters.py", line 292, in <listcomp>
    {
  File "/home/sergeyb/.local/lib/python3.10/site-packages/pycobertura/reporters.py", line 293, in <dictcomp>
    header_name: header_value[file_index]
IndexError: list index out of range

Version: 3.2.1, installed via pip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant