Skip to content

Commit 83e33a8

Browse files
authored
No need for a warning when tox-gh does what it's supposed to do (#77)
1 parent 8407301 commit 83e33a8

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/tox_gh/plugin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def tox_add_core_config(core_conf: ConfigSet, state: State) -> None:
6868
elif getattr(state.conf.options.env, "is_default_list", False) is False:
6969
bail_reason = f"envlist is explicitly given via {'TOXENV'if os.environ.get('TOXENV') else '-e flag'}"
7070
if bail_reason:
71-
logging.warning("tox-gh won't override envlist because %s", bail_reason)
71+
logging.debug("tox-gh won't override envlist because %s", bail_reason)
7272
return
7373

7474
logging.warning("running tox-gh")

tests/test_tox_gh.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,26 @@
1313

1414

1515
def test_gh_not_in_actions(monkeypatch: MonkeyPatch, tox_project: ToxProjectCreator) -> None:
16+
monkeypatch.delenv("GITHUB_ACTIONS", raising=False)
17+
project = tox_project({"tox.ini": "[testenv]\npackage=skip"})
18+
result = project.run("-vv")
19+
result.assert_success()
20+
assert "tox-gh won't override envlist because tox is not running in GitHub Actions" in result.out
21+
22+
23+
def test_gh_not_in_actions_quiet(monkeypatch: MonkeyPatch, tox_project: ToxProjectCreator) -> None:
1624
monkeypatch.delenv("GITHUB_ACTIONS", raising=False)
1725
project = tox_project({"tox.ini": "[testenv]\npackage=skip"})
1826
result = project.run()
1927
result.assert_success()
20-
assert "ROOT: tox-gh won't override envlist because tox is not running in GitHub Actions" in result.out
28+
assert "tox-gh won't override envlist because tox is not running in GitHub Actions" not in result.out
2129

2230

2331
def test_gh_e_flag_set(monkeypatch: MonkeyPatch, tox_project: ToxProjectCreator) -> None:
2432
monkeypatch.setenv("GITHUB_ACTIONS", "true")
2533
monkeypatch.delenv("TOXENV", raising=False)
2634
project = tox_project({"tox.ini": "[testenv]\npackage=skip"})
27-
result = project.run("-e", "py")
35+
result = project.run("-e", "py", "-vv")
2836
result.assert_success()
2937
assert "tox-gh won't override envlist because envlist is explicitly given via -e flag" in result.out
3038

@@ -33,7 +41,7 @@ def test_gh_toxenv_set(monkeypatch: MonkeyPatch, tox_project: ToxProjectCreator)
3341
monkeypatch.setenv("GITHUB_ACTIONS", "true")
3442
monkeypatch.setenv("TOXENV", "py")
3543
project = tox_project({"tox.ini": "[testenv]\npackage=skip"})
36-
result = project.run()
44+
result = project.run("-vv")
3745
result.assert_success()
3846
assert "tox-gh won't override envlist because envlist is explicitly given via TOXENV" in result.out
3947

0 commit comments

Comments
 (0)