pytest-dev / py

Python development support library (note: maintenance only)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Building with pytest4 does not work at all

scarabeusiv opened this issue · comments

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...

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+.

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'>

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

Agreed! 👍