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

Add support for 'skip_covered' option in terminal report section #115

Merged
merged 4 commits into from Jun 20, 2016

Conversation

Projects
None yet
2 participants
@theskumar
Contributor

theskumar commented May 10, 2016

This is a working implementation and works fine with .coveragerc and setup.cfg.

I've not added relevant docs and test, as i'm still trying to understand those.

@ionelmc if this looks good, i'll try to add docs and tests.

Ref: http://coverage.readthedocs.io/en/latest/api_coverage.html#coverage.Coverage.report

closes #114

@ionelmc

This comment has been minimized.

Member

ionelmc commented May 10, 2016

Looks fine. If you need any help with the tests just ping me. (I suspect you can do something like test_coveragerc)

@theskumar

This comment has been minimized.

Contributor

theskumar commented May 11, 2016

Thanks.

I've updated the PR with 1) compatibility with older version of coverage 2) tests 3) docs.

@ionelmc It would be great if you can have look & squash/merge/release.

Best.

@ionelmc

This comment has been minimized.

Member

ionelmc commented May 12, 2016

One question tho, sorry for bringing this up so late: Shouldn't we allow users to have skip_covered option when they use --cov-report=term-missing? In that case we'd only need to change a bit the option parser to allow stuff like --cov-report=term-missing:skip-covered and --cov-report=term:skip-covered. What do you think?

@theskumar

This comment has been minimized.

Contributor

theskumar commented May 12, 2016

so currently this is achievable with

--cov-report=term-missing --cov-report=term-skip-covered

I agree that the suggested api is cleaner, I just when the existing style... i.e. term, term-missing.
Happy to change it, if you prefer.

@ionelmc

This comment has been minimized.

Member

ionelmc commented May 12, 2016

I think it's better for the users, not obvious that --cov-report=term-missing and --cov-report=term-skip-covered actually compose, at least not in my head.

@theskumar

This comment has been minimized.

Contributor

theskumar commented May 12, 2016

Agreed. I'll take a stab at changing it.

One thing i didn't understand while working on this is: how does the skip_covered setting in .coveragerc started to get recognised by only adding an addition parameter to self.cov.report(...).

@ionelmc

This comment has been minimized.

Member

ionelmc commented May 12, 2016

I suspect it's loaded when the cov object is created (and .coveragerc is loaded). We should have a test for this, just in case something regresses.

@ionelmc

This comment has been minimized.

Member

ionelmc commented Jun 1, 2016

@theskumar hey, still have time for this?

@theskumar

This comment has been minimized.

Contributor

theskumar commented Jun 1, 2016

So i've been looking into it, and it's taking more time than I expected. I guess, mostly in the validate_report function. Happy to have someone take over this feature. I'm bit occupied as well, so just getting only short bursts of time to work.

theskumar added some commits May 10, 2016

Add support for 'skip_covered' option in terminal report section
- Use skip_covered only coverage version >= 4
- Add test
- Update docs
@theskumar

This comment has been minimized.

Contributor

theskumar commented Jun 20, 2016

@ionelmc I've updated the cli usages as suggested by you. And separated the .coveragerc test.

Let me know, if anything else needs to be done for this to be merged. Thanks.

@ionelmc

This comment has been minimized.

Member

ionelmc commented Jun 20, 2016

Looks good, thanks. Gonna wait just a bit for Travis to finish.

@theskumar

This comment has been minimized.

Contributor

theskumar commented Jun 20, 2016

test failing :/ taking a look and will get back.

@theskumar

This comment has been minimized.

Contributor

theskumar commented Jun 20, 2016

Updated PR with fix. Pretty sure, this will not fail!

@ionelmc ionelmc merged commit a1e8174 into pytest-dev:master Jun 20, 2016

@ionelmc

This comment has been minimized.

Member

ionelmc commented Jun 20, 2016

Alright, thanks for the changes.

@theskumar theskumar deleted the theskumar:skip-covered-support branch Jun 20, 2016

jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Aug 22, 2016

wiz
Updated py-test-cov to 2.3.1.
2.3.1 (2016-08-07)
------------------

* Fixed regression causing spurious errors when xdist was used. See `#124
  <https://github.com/pytest-dev/pytest-cov/issues/124>`_.
* Fixed DeprecationWarning about incorrect `addoption` use. Contributed by Florian Bruhin in `PR#127
  <https://github.com/pytest-dev/pytest-cov/pull/127>`_.
* Fixed deprecated use of funcarg fixture API. Contributed by Daniel Hahler in `PR#125
  <https://github.com/pytest-dev/pytest-cov/pull/125>`_.

2.3.0 (2016-07-05)
------------------

* Add support for specifying output location for html, xml, and annotate report.
  Contributed by Patrick Lannigan in `PR#113 <https://github.com/pytest-dev/pytest-cov/pull/113>`_.
* Fix bug hiding test failure when cov-fail-under failed.
* For coverage >= 4.0, match the default behaviour of `coverage report` and
  error if coverage fails to find the source instead of just printing a warning.
  Contributed by David Szotten in `PR#116 <https://github.com/pytest-dev/pytest-cov/pull/116>`_.
* Fixed bug occurred when bare ``--cov`` parameter was used with xdist.
  Contributed by Michael Elovskikh in `PR#120 <https://github.com/pytest-dev/pytest-cov/pull/120>`_.
* Add support for ``skip_covered`` and added ``--cov-report=term-skip-covered`` command
  line options. Contributed by Saurabh Kumar in `PR#115 <https://github.com/pytest-dev/pytest-cov/pull/115>`_.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment