Return a suffix for worker-unique resource names. Uses the built-in ``worker_id`` fixture from pytest-xdist which returns ``"gw0"``, ``"gw1"``, etc. for workers, or ``"master"`` for non-xdist runs.
(worker_id: str)
| 74 | |
| 75 | @pytest.fixture(scope="session") |
| 76 | def _worker_suffix(worker_id: str) -> str: |
| 77 | """Return a suffix for worker-unique resource names. |
| 78 | |
| 79 | Uses the built-in ``worker_id`` fixture from pytest-xdist which returns |
| 80 | ``"gw0"``, ``"gw1"``, etc. for workers, or ``"master"`` for non-xdist runs. |
| 81 | """ |
| 82 | if worker_id == "master": |
| 83 | return "" |
| 84 | return f"-{worker_id}" |
| 85 | |
| 86 | |
| 87 | @pytest.fixture |
nothing calls this directly
no outgoing calls
no test coverage detected