Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Enable color output from Nox, pytest, and pre-commit #542

Merged
merged 2 commits into from Dec 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
@@ -1,5 +1,8 @@
name: CI
on: [push, pull_request]
env:
FORCE_COLOR: "1"
PRE_COMMIT_COLOR: "always"
jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 2 additions & 0 deletions tests/test_main.py
Expand Up @@ -602,6 +602,7 @@ def test_main_noxfile_options_with_sessions_override(

@pytest.mark.parametrize(("isatty_value", "expected"), [(True, True), (False, False)])
def test_main_color_from_isatty(monkeypatch, isatty_value, expected):
monkeypatch.delenv("FORCE_COLOR")
monkeypatch.setattr(sys, "argv", [sys.executable])
with mock.patch("nox.workflow.execute") as execute:
execute.return_value = 0
Expand All @@ -626,6 +627,7 @@ def test_main_color_from_isatty(monkeypatch, isatty_value, expected):
],
)
def test_main_color_options(monkeypatch, color_opt, expected):
monkeypatch.delenv("FORCE_COLOR")
monkeypatch.setattr(sys, "argv", [sys.executable, color_opt])
with mock.patch("nox.workflow.execute") as execute:
execute.return_value = 0
Expand Down