Skip to content

Commit

Permalink
Remove Travis references (wntrblm#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
paw-lu authored and gwynforthewyn committed Mar 14, 2021
1 parent 082c266 commit 2c50092
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ To run against a particular Python version:
nox --session tests-3.9


When you send a pull request Travis will handle running everything, but it is
When you send a pull request the CI will handle running everything, but it is
recommended to test as much as possible locally before pushing.

## Getting a sticker
Expand Down
7 changes: 7 additions & 0 deletions nox/_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,13 @@ def _session_completer(
hidden=True,
finalizer_func=_color_finalizer,
),
_option_set.Option(
"no_install",
"--no-install",
group=options.groups["secondary"],
action="store_true",
help="Skip invocations of session methods for installing packages.",
),
)


Expand Down
5 changes: 5 additions & 0 deletions nox/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,11 @@ def install(self, *args: str, **kwargs: Any) -> None:
.. _pip: https://pip.readthedocs.org
"""

if self._runner.global_config.no_install:
logger.info("Skipping {} installation, as --no-install is set.".format(args[0]))
return None

if not isinstance(
self._runner.venv, (CondaEnv, VirtualEnv, PassthroughEnv)
): # pragma: no cover
Expand Down
14 changes: 14 additions & 0 deletions tests/test_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,18 @@ def test_run_install_only(self, caplog):

assert "install-only" in caplog.text

def test_run_no_install(self, caplog):
caplog.set_level(logging.INFO)
session, runner = self.make_session_and_runner()
runner.global_config.no_install = True

with mock.patch.object(nox.command, "run") as run:
assert session.install("eggs", "spam") is None

run.assert_not_called()

assert "no-install" in caplog.text

def test_run_install_only_should_install(self):
session, runner = self.make_session_and_runner()
runner.global_config.install_only = True
Expand Down Expand Up @@ -500,6 +512,7 @@ class SessionNoSlots(nox.sessions.Session):
external="error",
)


def test_notify(self):
session, runner = self.make_session_and_runner()

Expand Down Expand Up @@ -568,6 +581,7 @@ def make_runner(self):
)
return runner


def test_properties(self):
runner = self.make_runner()

Expand Down

0 comments on commit 2c50092

Please sign in to comment.