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

CodeUnit doesn't handle eggs #25

Closed
nedbat opened this issue Sep 28, 2009 · 8 comments
Closed

CodeUnit doesn't handle eggs #25

nedbat opened this issue Sep 28, 2009 · 8 comments
Labels
bug Something isn't working

Comments

@nedbat
Copy link
Owner

nedbat commented Sep 28, 2009

Originally reported by rozza (Bitbucket: rozza, GitHub: rozza)


CodeUnit fails with eggs as the files aren't actually available for reading.

Patch included


@nedbat
Copy link
Owner Author

nedbat commented Sep 28, 2009

Issue #26 was marked as a duplicate of this issue.

@nedbat
Copy link
Owner Author

nedbat commented Sep 30, 2009

Thanks! This is fixed in <<changeset 92b5372042d2 (bb)>>

@nedbat
Copy link
Owner Author

nedbat commented Nov 4, 2013

Original comment by Vanuan (Bitbucket: Vanuan, GitHub: Vanuan)


Alas, it is not fixed everywhere consistently.

results.py and codeunit.py contain duplicated code.

The bug still exists in results.py:

https://bitbucket.org/ned/coveragepy/src/a621660fa6e671477500b723a8ead869c0bdfea5/coverage/results.py?at=default#cl-90

if source:

should be

if source is not None:

@nedbat
Copy link
Owner Author

nedbat commented Nov 4, 2013

Original comment by Vanuan (Bitbucket: Vanuan, GitHub: Vanuan)


Similar bugs in parser.py (lines 27, 337)

https://bitbucket.org/ned/coveragepy/src/a621660fa6e6/coverage/parser.py?at=default#cl-27
https://bitbucket.org/ned/coveragepy/src/a621660fa6e6/coverage/parser.py?at=default#cl-337

should be fixed the same way.

This is due to the fact that the file __init__.py could be empty (its length is zero).

@nedbat
Copy link
Owner Author

nedbat commented Nov 4, 2013

Original comment by Vanuan (Bitbucket: Vanuan, GitHub: Vanuan)


The fix is trivial: Vanuan/coveragepy@f453ced

@nedbat
Copy link
Owner Author

nedbat commented Nov 5, 2013

Vanuan: can you provide some test scenarios?

@nedbat
Copy link
Owner Author

nedbat commented Nov 5, 2013

Original comment by Vanuan (Bitbucket: Vanuan, GitHub: Vanuan)


I'm afraid I need some help here.

The test case should look like that:

  • coverage run import_egg1.py
  • coverage html

where import_egg1.py contains import egg1 and egg1 is an egg module (and contains an empty __init__.py).

My best effort is here: Vanuan/coveragepy@7cba392

@nedbat
Copy link
Owner Author

nedbat commented Oct 4, 2015

I tried to duplicate this using the egg1 egg in the tests directory, with coverage 4.0. There were no problems. Maybe I don't know how to reproduce it. If you can give me manual steps to make it fail, I'll re-open the issue.

@nedbat nedbat closed this as completed Oct 4, 2015
@nedbat nedbat added major bug Something isn't working labels Jun 23, 2018
agronholm added a commit to agronholm/coveragepy that referenced this issue Aug 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant