Skip to content

Commit

Permalink
tests: add test for modern parametrize
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii committed Oct 26, 2024
1 parent 661674a commit d1f72a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 1 addition & 2 deletions nox/_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ def extend_walk(
walk_list = list(walk)
cycle = walk_list[walk_list.index(node) :] + [node]
raise CycleError("Nodes are in a dependency cycle", tuple(cycle))
else:
walk[node] = None
walk[node] = None
return walk

sort = prepended_by_dependencies(root)
Expand Down
9 changes: 9 additions & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ def test_main_with_bad_session_names(run_nox, session):
(("g", "a", "d"), ("b", "c", "h", "g", "a", "e", "d")),
(("m",), ("k-3.9", "k-3.10", "m")),
(("n",), ("k-3.10", "n")),
(("v",), ("u(django='1.9')", "u(django='2.0')", "v")),
(("u",), ("u(django='1.9')", "u(django='2.0')", "u")),
],
)
def test_main_requires(run_nox, sessions, expected_order):
Expand Down Expand Up @@ -539,6 +541,13 @@ def test_main_requires_chain_fail(run_nox, session):
assert "Prerequisite session r was not successful" in stderr


@pytest.mark.parametrize("session", ("w", "u"))
def test_main_requries_modern_param(run_nox, session):
noxfile = os.path.join(RESOURCES, "noxfile_requires.py")
returncode, _, stderr = run_nox(f"--noxfile={noxfile}", f"--session={session}")
assert returncode == 0


def test_main_noxfile_options(monkeypatch, generate_noxfile_options):
noxfile_path = generate_noxfile_options(reuse_existing_virtualenvs=True)
monkeypatch.setattr(
Expand Down

0 comments on commit d1f72a8

Please sign in to comment.