Skip to content

Empty __init__.py files are reported as 1 executable line. #1

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

Closed
nedbat opened this issue Apr 11, 2009 · 3 comments
Closed

Empty __init__.py files are reported as 1 executable line. #1

nedbat opened this issue Apr 11, 2009 · 3 comments
Labels
bug Something isn't working

Comments

@nedbat
Copy link
Owner

nedbat commented Apr 11, 2009

This is counter-intuitive. It'd be better (but not essential) for it to match people's perception, which is that an empty init.py has no executable lines.


@nedbat
Copy link
Owner Author

nedbat commented Apr 11, 2009

An empty file is compiled to this:

magic [b3f20d0a (bb)](https://bitbucket.org/ned/coveragepy/commits/b3f20d0a)
moddate [d105e149 (bb)](https://bitbucket.org/ned/coveragepy/commits/d105e149) (Sat Apr 11 17:04:17 2009)
code
   argcount 0
   nlocals 0
   stacksize 1
   flags 0040
   code [64000053 (bb)](https://bitbucket.org/ned/coveragepy/commits/64000053)
  1           0 LOAD_CONST               0 (None)
              3 RETURN_VALUE
   consts
      None
   names ()
   varnames ()
   freevars ()
   cellvars ()
   filename '.\\empty.py'
   name '<module>'
   firstlineno 1
   lnotab

@nedbat
Copy link
Owner Author

nedbat commented Jun 14, 2009

Removing version: 3.0b1 (automated comment)

@nedbat
Copy link
Owner Author

nedbat commented Jun 27, 2010

Fixed in <<changeset 4dd38432467c (bb)>>.

@nedbat nedbat closed this as completed Jun 27, 2010
@nedbat nedbat added major bug Something isn't working labels Jun 23, 2018
nedbat pushed a commit that referenced this issue Jun 28, 2018
Fix some build issues on CI servers.
agronholm added a commit to agronholm/coveragepy that referenced this issue Aug 16, 2020
nedbat pushed a commit that referenced this issue Nov 2, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
test: add another test of correct report formatting
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