Skip to content

pytest runner with -n flag fails on repos using Decimal #116

@hughhan1

Description

@hughhan1

Problem

Running rtest --runner pytest -n 4 on more-itertools fails because pytest-xdist can't serialize Decimal objects across worker processes.

execnet.gateway_base.DumpError: can't serialize <class 'decimal.Decimal'>

Tests pass fine without parallelization (rtest --runner pytest works).

Reproduction

git clone https://github.com/more-itertools/more-itertools
cd more-itertools
uv venv && uv sync --all-groups
uv pip install pytest-xdist rtest

# Works
.venv/bin/rtest --runner pytest tests

# Fails
.venv/bin/rtest --runner pytest -n 4 tests

Notes

This is may a pytest-xdist limitation. But worth tracking since it affects which repos can use parallel pytest execution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions