Skip to content
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

Allow custom scheduler names in --dist command line argument #1148

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amezin
Copy link
Collaborator

@amezin amezin commented Nov 1, 2024

There seems to be no way to fix the argument validation, at least without complicating things unnecessarily.

So simply remove it. Instead, check pytest_xdist_make_scheduler return value.

Also, convert every built-in scheduler to a separate plugin.

Fixes: #970

There seems to be no way to fix the argument validation, at least without
complicating things unnecessarily.

So simply remove it. Instead, check `pytest_xdist_make_scheduler` return
value.

Also, convert every builtin scheduler to a separate plugin.

Fixes: pytest-dev#970
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.

I'd like to introduce a xdist.scheduler entrypoint

A sheduler should have a from_config named ctor so the init can be dumb

The entrypoint should either point to the classes or to the factory

I slightly prefer pointing to the factory as it allows to evolve things later

@@ -101,15 +101,6 @@ def pytest_addoption(parser: pytest.Parser) -> None:
"--dist",
metavar="distmode",
action="store",
choices=[
Copy link
Member

Choose a reason for hiding this comment

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

Based on expected usage why not introduce a entrypoint

That way we get choices and extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing mechanism to extend the --dist choices when adding a new scheduler results in pytest execution failure
2 participants