Skip to content

Commit

Permalink
feat: Save passed name to func.name on decorated @session (#718)
Browse files Browse the repository at this point in the history
Closes #717
  • Loading branch information
MicaelJarniac authored Jul 12, 2023
1 parent 5e1f0c0 commit b4e8cae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions nox/_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def __init__(
self.func = func
self.python = python
self.reuse_venv = reuse_venv
self.name = name
self.venv_backend = venv_backend
self.venv_params = venv_params
self.should_warn = should_warn or {}
Expand Down
7 changes: 5 additions & 2 deletions nox/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,11 @@ def session_decorator(
if python is None:
python = py

fn = Func(func, python, reuse_venv, name, venv_backend, venv_params, tags=tags)
_REGISTRY[name or func.__name__] = fn
final_name = name or func.__name__
fn = Func(
func, python, reuse_venv, final_name, venv_backend, venv_params, tags=tags
)
_REGISTRY[final_name] = fn
return fn


Expand Down

0 comments on commit b4e8cae

Please sign in to comment.