On 26.08.2016 15:00, Bruno Oliveira wrote:
On Fri, Aug 26, 2016 at 9:54 AM Ronny Pfannschmidt
<[email protected]
<mailto:[email protected]>> 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).
it does not even need an alternative - there is *import* of python
people can just import their objects from their locations *and* have
code completion/analysis work
since the namespace hook is executed at pre config time it has next to
no added value except for monkeypatching py.test's own namespace
as a utility of convenience
i think all it needs is some kind of wrapper for the namespace noting
that this feature was deprecated on usage
then for 4.0 we could make the namespace lazy-loaded, and for 5.0 we
could remove it altogether
-- Ronny
_______________________________________________
pytest-dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pytest-dev