[pytest-dev] [proposal] deprecating the pytest_namespace hook

Bruno Oliveira nicoddemus at gmail.com
Fri Aug 26 09:00:56 EDT 2016


On Fri, Aug 26, 2016 at 9:54 AM Ronny Pfannschmidt <
opensource at ronnypfannschmidt.de> wrote:

> the problem it creates is, that we need to load plugins before even
> parsing the config and before even having config object just in order to
> literally monkeypatch a module
>

You mean that just importing "pytest" you automatically load all plugins?
Hmmm I agree that's not very nice.

the second problem it creates is, it makes the pytest namespace impossible
> to introspect for external tools
>

I agree that's annoying, but that's a problem in general on how dynamic
pytest is (IDEs don't autocomplete on fixture parameters either), so I
would say this is small.


> also - import works just fine - there is no need for a dynamic namespace,
> people can import from concrete/correct locations
>

I see, but TBH I don't see how we could just deprecate that without
providing an alternative solution which won't break user code. Too many
plugins and code depend on that, and we would need to have a **really**
good reason to break them all in a future pytest version (I wouldn't even
dare to introduce such a deprecation until 4.0 for example).

But that's my opinion of course.

Cheers,
Bruno.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20160826/b1697df0/attachment.html>


More information about the pytest-dev mailing list