Skip to content

hatch test -py 3.9 no longer works (in 1.16.0 and newer) #2117

@dhdaines

Description

@dhdaines

Since hatch 1.16.0 it no longer works to call hatch test with python 3.9 (whether installed by hatch python install or not).

To reproduce:

hatch python install 3.9
hatch new test-test
cd test-test
hatch test         # will succeed
hatch test -py 3.9  # will do nothing
hatch test -py 3.9 --cover # will crash with IndexError

The exception for hatch test --cover -py 3.9:

│ /home/dhd/.local/pipx/venvs/hatch/lib/python3.11/site-packages/hatch/cli/test/__init__.py:199 in │
│ test                                                                                             │
│                                                                                                  │
│   196 │   │   │   context.env_vars["COVERAGE_PROCESS_START"] = coverage_config_file              │
│   197 │                                                                                          │
│   198 │   if cover:                                                                              │
│ ❱ 199 │   │   for context in app.runner_context([selected_envs[0]]):                             │
│   200 │   │   │   context.add_shell_command("cov-combine")                                       │
│   201 │   │                                                                                      │
│   202 │   │   if not cover_quiet:                                                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
IndexError: list index out of range

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