Skip to content

Nox does not raise an error when wrong option is set: reuse_venv #869

@smarie

Description

@smarie

Current Behavior

I was giving a training today and I wanted to show how nox can be configured to reuse existing virtual environments.
This is what I wrote in noxfile.py :

nox.options.reuse_venv = True

Unfortunately nox does not raise any error and continues to run ! I did not realize it but if you look carefully it actually tells us that it (re)creates the env :

image

This is the correct way to tell nox to reuse virtual environments for all sessions :

nox.options.reuse_existing_virtualenvs = True

And we can check it that way

image

Expected Behavior

I would expect that an unsupported option in noxfile.py

nox.options.reuse_venv = True

would raise an error when running nox

Steps To Reproduce

see above

Environment

- OS: Windows 10
- Python: 3.11.4
- Nox: 2024.4.15

Anything else?

See #488 for related recent PR

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