[pytest-dev] can we remove the deprecated pytest.config variable assignment before 3.0

Bruno Oliveira nicoddemus at gmail.com
Thu Jul 21 08:09:12 EDT 2016


On Thu, Jul 21, 2016 at 2:29 AM Ronny Pfannschmidt <rpfannsc at redhat.com>
wrote:

Looks fabulous, turn to a PR?
>
Sorry, are you asking me to do it, or if you should do it yourself? If you
could tackle that it would be great, otherwise I think I will have some
time tonight to do it.

Maybe move to a _pytest.deprecated plugin
>
Hmmm it might be useful to have this, specially as a central point to have
deprecated stuff so it is clear what should be removed when 4.0 comes
around. We don’t even need to move the entire deprecated functionality,
just put something in this deprecated plugin as a reminder.

As an example of what I mean, we recently deprecated declaring fixtures
with "pytest_funcarg__" prefix. The fixture collection code uses a variable
_argprefix to check if a function is a fixture:

            if marker is None:
                if not name.startswith(self._argprefix):
                    continue
                if not callable(obj):
                    continue
                marker = defaultfuncargprefixmarker
                name = name[len(self._argprefix):]

The suggestion would then to move self._argprefix to the deprecated plugin:

            if marker is None:
                if not name.startswith(_pytest.deprecated.argprefix):
                    continue
                if not callable(obj):
                    continue
                marker = defaultfuncargprefixmarker
                name = name[len(_pytest.deprecated.argprefix):]

By the time pytest 4.0 comes around, technically it would be a matter of
deleting the contents of _pytest.deprecated and fix what “breaks”.

What do you guys think, is this worth having?

Thanks,
Bruno.
​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20160721/7fc55d90/attachment.html>


More information about the pytest-dev mailing list