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

Show errors on insufficient cov #116

Merged
merged 14 commits into from Jun 1, 2016

Conversation

Projects
None yet
2 participants
@davidszotten
Contributor

davidszotten commented May 11, 2016

don't hide failed tests when cov-fail-under fails

c.f. #108

also tweaks failure semantics slightly, see changelog (hence minor version bump)

@@ -8,7 +8,7 @@
import py
import pytest
import virtualenv
from process_tests import TestProcess

This comment has been minimized.

@ionelmc

ionelmc May 11, 2016

Member

Did this interfere with the default test collection settings?

This comment has been minimized.

@davidszotten

davidszotten May 11, 2016

Contributor

this is just to suppress the warnings (mentioned in the commit message, but i agree that's not very visible). would you prefer a code comment?

return
if self.cov_total is None:
# we shouldn't report, or report generation failed (error raised above)

This comment has been minimized.

@ionelmc

ionelmc May 11, 2016

Member

We should still have the old assertion no? Or pytest_terminal_summary is called regardless of pytest_runtestloop raising an error? When does that happen?

This comment has been minimized.

@davidszotten

davidszotten May 11, 2016

Contributor

summary is called regardless, so we get to this comment in the two cases indicated

@ionelmc

This comment has been minimized.

Member

ionelmc commented May 11, 2016

Hey, thanks for this improvement! I'm adding couple questions on the diff.

@davidszotten

This comment has been minimized.

Contributor

davidszotten commented May 11, 2016

thanks. replied inline

looks like one of the tests fails on cov 3.7 due to cov silently ignoring non-existent sources. updating to match cov behaviour by version

@ionelmc

This comment has been minimized.

Member

ionelmc commented May 15, 2016

I think this is quite fine. I wonder if messing with session.testsfailed/session._testsfailed would create any problems. I'm no pytest internals expert here, @RonnyPfannschmidt you think incrementing that attribute could be a problem?

@ionelmc ionelmc merged commit 489391e into pytest-dev:master Jun 1, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@ionelmc

This comment has been minimized.

Member

ionelmc commented Jun 1, 2016

Alright, merged now. Thanks for the improvement!

@davidszotten

This comment has been minimized.

Contributor

davidszotten commented Jun 1, 2016

cool, thanks!

@ionelmc

This comment has been minimized.

Member

ionelmc commented Aug 6, 2016

@davidszotten it looks like these cause regression (#124). I'm looking for a fix ...

It appears that pytest_runtestloop don't have a way to know if it's being called in a slave or in the master. Any ideas here?

ionelmc added a commit to ionelmc/pytest-cov that referenced this pull request Aug 6, 2016

@davidszotten

This comment has been minimized.

Contributor

davidszotten commented Aug 6, 2016

hi. just saw this though it looks like you found a fix already

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