Skip to content

Commit 11eee27

Browse files
authored
fix: better support for multiple session decorators (#1048)
Signed-off-by: Henry Schreiner <[email protected]>
1 parent c72769b commit 11eee27

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

nox/registry.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ def session_decorator(
102102
download_python=download_python,
103103
)
104104

105+
if isinstance(func, Func):
106+
func = func.func
107+
105108
if py is not None and python is not None:
106109
msg = (
107110
"The py argument to nox.session is an alias for the python "

tests/resources/noxfile_pythons.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55

66
@nox.session(python=["3.6"])
7+
@nox.session(name="other", python=["3.6"])
78
@nox.parametrize("cheese", ["cheddar", "jack", "brie"])
89
def snack(unused_session, cheese):
910
print(f"Noms, {cheese} so good!")

0 commit comments

Comments
 (0)