Skip to content

Commit

Permalink
Add unit test for --no-install when installing dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
cjolowicz committed Jun 1, 2021
1 parent cbed7bc commit 21b3b72
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/unit/test_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def test_invalid_constraint() -> None:


@pytest.mark.parametrize("no_install", [False, True])
def test_install_no_install(
def test_install_local_no_install(
sessionfactory: FakeSessionFactory, no_install: bool
) -> None:
"""It returns early with --no-install if the environment is being reused."""
Expand All @@ -193,6 +193,19 @@ def test_install_no_install(
assert cast(FakeSession, session).install_called is not no_install


@pytest.mark.parametrize("no_install", [False, True])
def test_install_dependency_no_install(
sessionfactory: FakeSessionFactory, no_install: bool
) -> None:
"""It returns early with --no-install if the environment is being reused."""
session = sessionfactory(no_install=no_install)
proxy = nox_poetry.Session(session)

proxy.install("first")

assert cast(FakeSession, session).install_called is not no_install


@pytest.mark.parametrize("no_install", [False, True])
def test_installroot_no_install(
sessionfactory: FakeSessionFactory, no_install: bool
Expand Down

0 comments on commit 21b3b72

Please sign in to comment.