New issue

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

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

Already on GitHub? Sign in to your account

Option to disable plugin autoload entirely #3784

Closed
hsoft opened this Issue Aug 5, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@hsoft
Member

hsoft commented Aug 5, 2018

I'm wondering what you would think about adding a new option to entirely disable the auto-loading of plugins though setuptools entrypoints, either through a command line argument or through an environment variable.

Test runs don't always run in isolated environments and there are some disruptive pytest plugins out there such as pytest-relaxed that will break test runs of projects that aren't made for it.

We get this problem in Gentoo when running some packages in test mode, as we can see in this issue. We're patching things around to make things work, but really, the most elegant way to solve this problem would be if we could somehow disable autoloading entirely and explicitly load required plugins for each package.

Would a PR that add this feature be welcome?

@RonnyPfannschmidt

This comment has been minimized.

Show comment
Hide comment
@RonnyPfannschmidt

RonnyPfannschmidt Aug 5, 2018

Member

,i recall planning for this in another issue in order to prevent unbounded loading of plugins and to give people control

Member

RonnyPfannschmidt commented Aug 5, 2018

,i recall planning for this in another issue in order to prevent unbounded loading of plugins and to give people control

@hsoft

This comment has been minimized.

Show comment
Hide comment
@hsoft

hsoft Aug 5, 2018

Member

@RonnyPfannschmidt oh, sorry if this is a duplicate. I searched opened and closed issue but didn't find anything that looked like this.

Member

hsoft commented Aug 5, 2018

@RonnyPfannschmidt oh, sorry if this is a duplicate. I searched opened and closed issue but didn't find anything that looked like this.

@RonnyPfannschmidt

This comment has been minimized.

Show comment
Hide comment
@RonnyPfannschmidt

RonnyPfannschmidt Aug 5, 2018

Member

@hsoft its good to have this explicit and in the open now - if its unfindable, its easy to loose it ^^

Member

RonnyPfannschmidt commented Aug 5, 2018

@hsoft its good to have this explicit and in the open now - if its unfindable, its easy to loose it ^^

hsoft added a commit to hsoft/pytest that referenced this issue Aug 6, 2018

Add option to disable plugin auto-loading
If `PYTEST_DISABLE_PLUGIN_AUTOLOAD` is set, disable auto-loading of
plugins through setuptools entrypoints. Only plugins that have been
explicitly specified are loaded.

ref #3784.

hsoft added a commit to hsoft/pytest that referenced this issue Aug 6, 2018

Add option to disable plugin auto-loading
If `PYTEST_DISABLE_PLUGIN_AUTOLOAD` is set, disable auto-loading of
plugins through setuptools entrypoints. Only plugins that have been
explicitly specified are loaded.

ref #3784.

hsoft added a commit to hsoft/pytest that referenced this issue Aug 6, 2018

Add option to disable plugin auto-loading
If `PYTEST_DISABLE_PLUGIN_AUTOLOAD` is set, disable auto-loading of
plugins through setuptools entrypoints. Only plugins that have been
explicitly specified are loaded.

ref #3784.

hsoft added a commit to hsoft/pytest that referenced this issue Aug 6, 2018

Add option to disable plugin auto-loading
If `PYTEST_DISABLE_PLUGIN_AUTOLOAD` is set, disable auto-loading of
plugins through setuptools entrypoints. Only plugins that have been
explicitly specified are loaded.

ref #3784.

hsoft added a commit to hsoft/pytest that referenced this issue Aug 6, 2018

Add option to disable plugin auto-loading
If `PYTEST_DISABLE_PLUGIN_AUTOLOAD` is set, disable auto-loading of
plugins through setuptools entrypoints. Only plugins that have been
explicitly specified are loaded.

ref #3784.
@hsoft

This comment has been minimized.

Show comment
Hide comment
@hsoft

hsoft Aug 6, 2018

Member

(hum, sorry for the commit spam)

So here's a tentative PR that gives an idea of what's involved in adding this feature.

Member

hsoft commented Aug 6, 2018

(hum, sorry for the commit spam)

So here's a tentative PR that gives an idea of what's involved in adding this feature.

hsoft added a commit to hsoft/pytest that referenced this issue Aug 7, 2018

Add option to disable plugin auto-loading
If `PYTEST_DISABLE_PLUGIN_AUTOLOAD` is set, disable auto-loading of
plugins through setuptools entrypoints. Only plugins that have been
explicitly specified are loaded.

ref #3784.
@nicoddemus

This comment has been minimized.

Show comment
Hide comment
@nicoddemus

nicoddemus Aug 9, 2018

Member

Fixed in #3787

Member

nicoddemus commented Aug 9, 2018

Fixed in #3787

@nicoddemus nicoddemus closed this Aug 9, 2018

blueyed added a commit to blueyed/pytest that referenced this issue Aug 27, 2018

Add option to disable plugin auto-loading
If `PYTEST_DISABLE_PLUGIN_AUTOLOAD` is set, disable auto-loading of
plugins through setuptools entrypoints. Only plugins that have been
explicitly specified are loaded.

ref #3784.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment