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

Turn warnings into errors in the test suite #78

Closed
nicoddemus opened this issue Aug 31, 2017 · 5 comments
Closed

Turn warnings into errors in the test suite #78

nicoddemus opened this issue Aug 31, 2017 · 5 comments

Comments

@nicoddemus
Copy link
Member

Currently the test suite is issuing this warnings:

=============================== warnings summary ===============================
testing/test_method_ordering.py::test_add_tracefuncs[spec-is-class]
  /home/travis/build/nicoddemus/pluggy/.tox/py34/lib/python3.4/site-packages/pluggy/__init__.py:678: UserWarning: Argument(s) ('arg',) which are declared in the hookspec can not be found in this hook call
    .format(tuple(notincall))
testing/test_method_ordering.py::test_add_tracefuncs[spec-is-instance]
  /home/travis/build/nicoddemus/pluggy/.tox/py34/lib/python3.4/site-packages/pluggy/__init__.py:678: UserWarning: Argument(s) ('arg',) which are declared in the hookspec can not be found in this hook call
    .format(tuple(notincall))
testing/test_pluginmanager.py::test_call_with_too_few_args
  /home/travis/build/nicoddemus/pluggy/.tox/py34/lib/python3.4/site-packages/pluggy/__init__.py:678: UserWarning: Argument(s) ('arg',) which are declared in the hookspec can not be found in this hook call
    .format(tuple(notincall))
-- Docs: http://doc.pytest.org/en/latest/warnings.html

Turning them into errors or at least mark them as "known" is a good way to catch incompatibilities early.

@goodboy
Copy link
Contributor

goodboy commented Sep 1, 2017

@nicoddemus yeah test_call_with_too_few_args is obviously an intentional case but the first two can probably just be fixed.

We can error on warnings with pytest setting yah?

@nicoddemus
Copy link
Member Author

Yep, just configure it on pytest.ini:

[pytest]
filterwarnings =
    error

@goodboy
Copy link
Contributor

goodboy commented Sep 2, 2017

Hit the first problem:

DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() or inspect.getfullargspec()

For py2 we need inspect.getargspec() but on py3 we're supposed to use inspect.signature (3.5+) or inspect.getfullargspec (3 < py < 3.5).

Doing a quick search the dual compatibility fix looks something this.

I think we'll need a separate issue for that.

@RonnyPfannschmidt
Copy link
Member

i wonder if it would work to just go for funcsigs2 on python2 (its a backport)

@nicoddemus
Copy link
Member Author

If that works I would rather that than cook something up.

nicoddemus added a commit to nicoddemus/pluggy that referenced this issue Sep 12, 2017
- Fix two correct warnings
- Used pytest.warns() around a valid warning being issued

Should remove the warning exception for pytest-dev#81 when we tackle that.

Fix pytest-dev#78
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants