Weird line numbers in .coverage after eventlet.monkey_patch on Python 2.7

Issue #527 closed
Andrei Fokau created an issue

I am trying to figure out why some lines are missing in coverage report and noticed that some line numbers in .coverage for the affected file are more than the total number of lines. I am trying to debug it but not sure if I will manage by myself.

Example for file having 93 lines:

"somedjangoproject/tests.py": [2, 3, 4, 5, 6, 7, 8, 9, 12, 14, 22, 29, 39, 48, 53, 187, 
188, 61, 66, 74, 75, 76, 79, 80, 81, 189]

Comments (13)

  1. Ned Batchelder repo owner

    @andreif thanks for the bug report. Can you provide me with a reproducible test case? Even if it's a link to your full repo with instructions on how to run the tests, that would be great.

  2. Andrei Fokau reporter

    Sorry, private project, cannot do that.

    If I copy the test function in the same file, the second works fine and the first one misses some lines as before. Still digging...

  3. Andrei Fokau reporter

    Next line event after the exception, has wrong self.cur_file_dict. Ned, is there a good reason why you are using self.cur_file_dict instead of self.data[frame.f_code.co_filename]? It would seem as a proper way to me, but I don't have a good insight in your code so may miss the reason for it.

  4. Andrei Fokau reporter

    The exception happens in a try-except-finally block where it's re-raised. self.data_stack contains 3 items from that module before correct tests.py. I guess I would be able to make a demo case for it.

  5. Ned Batchelder repo owner

    @andreif thanks for digging into it. Do you have a reproducible test case for me?

  6. Andrei Fokau reporter

    @ned I did not manage to make a simple case for it. Mainly because I don't understand why it happens.

  7. Ned Batchelder repo owner

    @andreif without a way to reproduce it, I don't know what I can do about it. If you find a way to demonstrate it, feel free to reopen the issue.

  8. Log in to comment