Skip to content

session.run does not fail gracefully when receiving a list as command to run #746

@stefanv

Description

@stefanv

Current Behavior

session.run(["pytests", "mypkg"]) results in a traceback.

Expected Behavior

One of the following options:

(a) The error is caught and a helpful message displayed.
(b) The list is correctly intepreted as a command.

Steps To Reproduce

import nox


@nox.session
def tests(session: nox.Session) -> None:
    session.run(["pytest", "foo"])

Environment

- OS: Linux
- Python: 3.11
- Nox: 2023.4.22

Anything else?

I would be happy to submit a PR to address the issue, once I know which solution is preferred.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions