Skip to content

Option to set the default distribution algorithm #789

Closed
@DavideCanton

Description

@DavideCanton

Hi, I have the following scenario:

  • I have some tests that need to be run in the same worker due to the fact they use a shared object (I know it's not very idiomatic for unit tests, but it is really the simpler way to check what I need to check)
  • I saw the --dist loadgroup option, but unfortunately it is not the default, so I should remember to specify every time the command line option
  • I can't add it to the addopts setting since it errors if I don't specify either -n or -tx, and I want to be able to choose to run the tests the standard way too.

What could work for me is a setting to set the default algorithm to use when --dist is not specified, so that:

  • if I run pytest standalone, it doesn't run in parallel
  • if I run pytest -n auto, it uses the algorithm specified in the setting
  • if I run pytest -n auto --dist loadfile, it overrides the setting with the loadfile algorithm.

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