Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Building with pytest4 does not work at all #209

Closed
scarabeusiv opened this issue Feb 15, 2019 · 3 comments · May be fixed by #222
Closed

Building with pytest4 does not work at all #209

scarabeusiv opened this issue Feb 15, 2019 · 3 comments · May be fixed by #222

Comments

@scarabeusiv
Copy link

In distributions we try to have tests enabled to ensure updating components does not break the applications shipped, esp. with python which is evaluated on runtime this is crucial. But we can't provide multiple versions of pytest and as such we can't do the same process like in here where you pinned old version of pytest and are happy.

Full log py.txt

This is tied to issue #162 which I for now solved by deleting the offending test file...

@blueyed
Copy link
Contributor

blueyed commented Feb 15, 2019

Yeah, it's in bad shape.

For now you could try building with tox instead - after all pytest is only used to run the tests, but pytest itself works with the latest py.

@nicoddemus @RonnyPfannschmidt
As for fixing the tests:
What minimum pytest version do we want to use?
I think for the removal of getfuncargvalue alone it would make sense to only test with pytest 3.0+.

@blueyed
Copy link
Contributor

blueyed commented Feb 15, 2019

I assume the usage of pytest_funcarg__* needs to be replaced, and the FAQ being removed?

py/doc/faq.txt

Lines 101 to 113 in a7847ed

.. _`why pytest_pyfuncarg__ methods?`:
Why the ``pytest_funcarg__*`` name for funcarg factories?
---------------------------------------------------------------
When experimenting with funcargs an explicit registration mechanism
was considered. But lacking a good use case for this indirection and
flexibility we decided to go for `Convention over Configuration`_ and
allow to directly specify the factory. Besides removing the need
for an indirection it allows to "grep" for ``pytest_funcarg__MYARG``
and will safely find all factory functions for the ``MYARG`` function
argument. It helps to alleviate the de-coupling of function
argument usage and creation.

It is causing:

pluggy.manager.PluginValidationError: unknown hook 'pytest_funcarg__repowc1' in plugin <module 'conftest' from '…/py/testing/path/conftest.py'>

@nicoddemus
Copy link
Member

I think for the removal of getfuncargvalue alone it would make sense to only test with pytest 3.0+.

Agreed! 👍

stanislavlevin added a commit to stanislavlevin/py that referenced this issue Jun 4, 2019
This patch should fix such errors/warnings as:

- raises / warns with a string as the second argument
Deprecated since version 4.1.

- pytest_funcarg__ prefix
Removed in version 4.0.

- getfuncargvalue

- Metafunc.addcall
Removed in version 4.0.

Fixes: pytest-dev#209
Signed-off-by: Stanislav Levin <slev@altlinux.org>
@RonnyPfannschmidt RonnyPfannschmidt closed this as not planned Won't fix, can't repro, duplicate, stale Oct 20, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants