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

Pass a type instead of string to parser.addoption #127

Merged
merged 1 commit into from Aug 5, 2016

Conversation

Projects
None yet
2 participants
@The-Compiler
Member

The-Compiler commented Aug 5, 2016

Otherwise we get this DeprecationWarning with pytest 3.0:

  [...]
  File ".../pytest_cov/plugin.py", line 72, in pytest_addoption
    help='Fail if the total coverage is less than MIN.')
  File ".../_pytest/config.py", line 482, in addoption
    self._anonymous.addoption(*opts, **attrs)
  File ".../_pytest/config.py", line 708, in addoption
    option = Argument(*optnames, **attrs)
  File ".../_pytest/config.py", line 609, in __init__
    stacklevel=3)
DeprecationWarning: type argument to addoption() is a string 'int'. For parsearg this should be a type. (options: ('--cov-fail-under',))
Pass a type instead of string to parser.addoption
Otherwise we get this DeprecationWarning with pytest 3.0:

      [...]
      File ".../pytest_cov/plugin.py", line 72, in pytest_addoption
        help='Fail if the total coverage is less than MIN.')
      File ".../_pytest/config.py", line 482, in addoption
        self._anonymous.addoption(*opts, **attrs)
      File ".../_pytest/config.py", line 708, in addoption
        option = Argument(*optnames, **attrs)
      File ".../_pytest/config.py", line 609, in __init__
        stacklevel=3)
    DeprecationWarning: type argument to addoption() is a string 'int'. For parsearg this should be a type. (options: ('--cov-fail-under',))
@ionelmc

This comment has been minimized.

Member

ionelmc commented Aug 5, 2016

Thanks!

@ionelmc ionelmc merged commit 3e209fe into pytest-dev:master Aug 5, 2016

1 check passed

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

@The-Compiler The-Compiler deleted the The-Compiler:type branch Aug 6, 2016

@The-Compiler

This comment has been minimized.

Member

The-Compiler commented Aug 6, 2016

We plan to release 3.0 somewhen next week, would be great if there was a new pytest-cov release with this in before that 😉

@ionelmc

This comment has been minimized.

Member

ionelmc commented Aug 6, 2016

Noted.

@ionelmc

This comment has been minimized.

Member

ionelmc commented Aug 7, 2016

fyi, released 2.3.1

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