8000 allow getting process number during test · Issue #47 · pytest-dev/pytest-xdist · GitHub
[go: up one dir, main page]

Skip to content
allow getting process number during test #47
@hellmanj

Description

@hellmanj

Hi, we have a limited number of test accounts with which to run our tests. We'd like to run our tests in parallel with xdist, but can't use the same account in different tests at the same time. We can choose which account to use in a fixture, but need to know which worker is running to determine which account to use.

So is there a way to get the worker number? I see output like

gw0 I / gw1 I
gw0 [53] / gw1 [53]

when I start the test session with two workers. So can I know if I'm gw0 or gw1 from within a fixture?

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

      0