Skip to content

Exception during test collection results in ZeroDivisionError #4

Open

Description

@jerry-git

In short, this:
pytest --splits 3 --group 1

results in this

File "/home/user/.venv/lib/python3.8/site-packages/pytest_split/plugin.py", line 114, in _calculate_suite_start_and_end_idx
    avg_duration_per_test = sum(stored_durations.values()) / len(stored_durations)
ZeroDivisionError: division by zero

if there's e.g. some ImportError during test collection.

The ZeroDivisionError hides the original exception.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions