Skip to content

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Dec 9, 2018

Alternative to #4518.

@blueyed blueyed changed the base branch from master to features December 9, 2018 12:23
Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that looks like a good start well done, the necessary hacking you had to do inside of the config initialization points to yet another area for the config object detanglement

@blueyed
Copy link
Contributor Author

blueyed commented Dec 9, 2018

The config hack would not be required if self.pluginmanager.load_setuptools_entrypoints("pytest11") would be more modular (

self.pluginmanager.load_setuptools_entrypoints("pytest11")
).

Given that this adds is_blocked for this, we could also override load_setuptools_entrypoints in PytestPluginmanager and skip them there.

But like asked in #4518 already: how to enable this for all of pytest's inner tests then?
Should pytester forward this? If so, should it use an env or default args?

@blueyed blueyed changed the title load_entrypoint_plugins option/marker [RFC] load_entrypoint_plugins option/marker Dec 9, 2018
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @blueyed!

Please take a look at my comments. Other than that, we should add the option to the reference page.

# Used to know when we are importing conftests after the pytest_configure stage
self._configured = False

def is_blocked(self, name):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be a bummer to write one, but I guess we should add a functional test for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, tests are fine.. :D

def pytest_addoption(self, parser):
parser.addini(
"load_entrypoint_plugins",
help="only load specified plugins via entrypoint",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use type="args" here to force this to always be a list.

@blueyed blueyed force-pushed the load_entrypoint_plugins branch from 9a81f1a to 476c357 Compare March 13, 2019 22:20
@blueyed
Copy link
Contributor Author

blueyed commented Mar 13, 2019

Rebased, and used type=args.

I came across this again, since pytest-pdb also gets used in inline runs and then throws an error if an attribute exists already.

@blueyed blueyed changed the title [RFC] load_entrypoint_plugins option/marker [WIP] load_entrypoint_plugins option/marker Mar 14, 2019
@blueyed blueyed force-pushed the load_entrypoint_plugins branch from fc323fa to a67f8b0 Compare April 4, 2019 12:15
@blueyed blueyed force-pushed the load_entrypoint_plugins branch from a67f8b0 to ebd606a Compare April 4, 2019 16:10
@nicoddemus
Copy link
Member

Hey @blueyed,

Closing this for the same reasons as the other PRs, feel free to re-open it if you're still interested. 👍

@nicoddemus nicoddemus closed this Jun 12, 2019
@pytest-dev pytest-dev deleted a comment from codecov bot Nov 3, 2019
@blueyed blueyed added the PR closed due to inactivity on occasion we do rounds to close up inactive PRs, this label makes it easier to track them label Nov 3, 2019
@blueyed blueyed deleted the load_entrypoint_plugins branch November 3, 2019 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR closed due to inactivity on occasion we do rounds to close up inactive PRs, this label makes it easier to track them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants