Skip to content

Commit

Permalink
Suppress warnings for test output
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Apr 24, 2024
1 parent 834a385 commit 050d3a6
Show file tree
Hide file tree
Showing 26 changed files with 23 additions and 42 deletions.
12 changes: 9 additions & 3 deletions tests/example_tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ qa = mypy, lint
[testenv]
commands = python --version
skip_install = True
setenv = PYTHONHASHSEED = 1234
setenv =
PYTHONHASHSEED = 1234
PYTHONWARNINGS=ignore

[testenv:build]
commands = python -c "print('This is the build testenv')"
Expand All @@ -18,9 +20,13 @@ setenv = PYTHONHASHSEED = 5678
[testenv:mypy]
commands = python -c "print('This is the mypy testenv')"
skip_install = True
setenv = PYTHONHASHSEED = 2468
setenv =
PYTHONHASHSEED = 2468
PYTHONWARNINGS=ignore

[testenv:lint]
commands = python -c "print('This is the lint testenv')"
skip_install = True
setenv = PYTHONHASHSEED = 1357
setenv =
PYTHONHASHSEED = 1357
PYTHONWARNINGS=ignore
17 changes: 14 additions & 3 deletions tests/example_tox_braces.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,17 @@ envlist =
test = py37-attrs{19.3,20.2}, py38-attrs{19.3,20.2}, py39-attrs{19.3,20.2}
qa = mypy, lint

[testenv:.package]
commands = python --version
skip_install = True
setenv = PYTHONWARNINGS=ignore

[testenv]
commands = python --version
skip_install = True
setenv = PYTHONHASHSEED = 1234
setenv =
PYTHONHASHSEED = 1234
PYTHONWARNINGS=ignore

[testenv:build]
commands = python -c "print('This is the build testenv')"
Expand All @@ -23,9 +30,13 @@ setenv = PYTHONHASHSEED = 5678
[testenv:mypy]
commands = python -c "print('This is the mypy testenv')"
skip_install = True
setenv = PYTHONHASHSEED = 2468
setenv =
PYTHONHASHSEED = 2468
PYTHONWARNINGS=ignore

[testenv:lint]
commands = python -c "print('This is the lint testenv')"
skip_install = True
setenv = PYTHONHASHSEED = 1357
setenv =
PYTHONHASHSEED = 1357
PYTHONWARNINGS=ignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.11/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
lint create: .../.tox/lint
lint installed: .../.tox/lint/lib/python3.11/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
lint run-test-pre: PYTHONHASHSEED='1357'
lint run-test: commands[0] | python -c 'print('"'"'This is the lint testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
WARNING: Ignoring '-n qa' option as '-e / --envlist' option given.
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.11/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ py311 create: .../.tox/py311
py311 run-test-pre: PYTHONHASHSEED='1234'
py311 run-test: commands[0] | python --version
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.11/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ py311 create: .../.tox/py311
py311 run-test-pre: PYTHONHASHSEED='1234'
py311 run-test: commands[0] | python --version
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.11/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.11/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
lint create: .../.tox/lint
lint installed: .../.tox/lint/lib/python3.11/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
lint run-test-pre: PYTHONHASHSEED='1357'
lint run-test: commands[0] | python -c 'print('"'"'This is the lint testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
lint create: .../.tox/lint
lint installed: .../.tox/lint/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
lint run-test-pre: PYTHONHASHSEED='1357'
lint run-test: commands[0] | python -c 'print('"'"'This is the lint testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
WARNING: Ignoring '-n qa' option as '-e / --envlist' option given.
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ py312 create: .../.tox/py312
py312 run-test-pre: PYTHONHASHSEED='1234'
py312 run-test: commands[0] | python --version
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ py312 create: .../.tox/py312
py312 run-test-pre: PYTHONHASHSEED='1234'
py312 run-test: commands[0] | python --version
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
lint create: .../.tox/lint
lint installed: .../.tox/lint/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
lint run-test-pre: PYTHONHASHSEED='1357'
lint run-test: commands[0] | python -c 'print('"'"'This is the lint testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.13/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
lint create: .../.tox/lint
lint installed: .../.tox/lint/lib/python3.13/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
lint run-test-pre: PYTHONHASHSEED='1357'
lint run-test: commands[0] | python -c 'print('"'"'This is the lint testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
WARNING: Ignoring '-n qa' option as '-e / --envlist' option given.
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.13/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ py313 create: .../.tox/py313
py313 run-test-pre: PYTHONHASHSEED='1234'
py313 run-test: commands[0] | python --version
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.13/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ py313 create: .../.tox/py313
py313 run-test-pre: PYTHONHASHSEED='1234'
py313 run-test: commands[0] | python --version
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.13/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.13/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
lint create: .../.tox/lint
lint installed: .../.tox/lint/lib/python3.13/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
lint run-test-pre: PYTHONHASHSEED='1357'
lint run-test: commands[0] | python -c 'print('"'"'This is the lint testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.11/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
lint create: .../.tox/lint
lint installed: .../.tox/lint/lib/python3.11/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
lint run-test-pre: PYTHONHASHSEED='1357'
lint run-test: commands[0] | python -c 'print('"'"'This is the lint testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
WARNING: Ignoring '-n qa' option as '-e / --envlist' option given.
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.11/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.11/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
lint create: .../.tox/lint
lint installed: .../.tox/lint/lib/python3.11/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
lint run-test-pre: PYTHONHASHSEED='1357'
lint run-test: commands[0] | python -c 'print('"'"'This is the lint testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
lint create: .../.tox/lint
lint installed: .../.tox/lint/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
lint run-test-pre: PYTHONHASHSEED='1357'
lint run-test: commands[0] | python -c 'print('"'"'This is the lint testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
WARNING: Ignoring '-n qa' option as '-e / --envlist' option given.
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
lint create: .../.tox/lint
lint installed: .../.tox/lint/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
lint run-test-pre: PYTHONHASHSEED='1357'
lint run-test: commands[0] | python -c 'print('"'"'This is the lint testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.13/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
lint create: .../.tox/lint
lint installed: .../.tox/lint/lib/python3.13/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
lint run-test-pre: PYTHONHASHSEED='1357'
lint run-test: commands[0] | python -c 'print('"'"'This is the lint testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
WARNING: Ignoring '-n qa' option as '-e / --envlist' option given.
mypy create: .../.tox/mypy
mypy installed: .../.tox/mypy/lib/python3.13/site-packages/pip/_internal/metadata/importlib/_envs.py:111: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html, from pip._vendor.pkg_resources import find_distributions
mypy run-test-pre: PYTHONHASHSEED='2468'
mypy run-test: commands[0] | python -c 'print('"'"'This is the mypy testenv'"'"')'
___________________________________ summary ____________________________________
Expand Down
Loading

0 comments on commit 050d3a6

Please sign in to comment.