Skip to content

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

Open
@vitaly-krugl

Description

@vitaly-krugl

Documentation says to use pytest_xdist_make_scheduler to add a new scheduler. However, command line parsing fails because the choices for the --dist command line option are fixed by xdist.plugin.pytest_addoption. Also, help string that documents each of the available options in --dist is not extensible to include the new scheduler choices.

$ pytest --basetemp ~/xdist-debug/basetemp/ -p my_xdist_schedulers.plugin -n 3 --dist mycoolnewscheduler
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: argument --dist: invalid choice: 'mycoolnewscheduler' (choose from 'each', 'load', 'loadscope', 'loadfile', 'loadgroup', 'worksteal', 'no')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions