Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
stefanv opened this issue Nov 9, 2023 · 1 comment · Fixed by #786
Closed

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

stefanv opened this issue Nov 9, 2023 · 1 comment · Fixed by #786
Labels

Comments

@stefanv
Copy link
Contributor

stefanv commented Nov 9, 2023

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.

@stefanv stefanv added the bug label Nov 9, 2023
@henryiii
Copy link
Collaborator

IMO a) is fine, it keeps the syntax and type hints simple, and you simply need to add a single character (*) to convert if you already have a list.

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

Successfully merging a pull request may close this issue.

2 participants