Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog/2342.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Avoid ignored explicit argument 're' console message. - by :user:`ssbarnea`.
6 changes: 6 additions & 0 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -242,3 +242,9 @@ that programs may issue custom exit codes with any value, so their documentation
Sometimes, no exit code is given at all. An example may be found in
:gh:`pytest-qt issue #170 <pytest-dev/pytest-qt/issues/170>`, where Qt was calling
`abort() <https://www.unix.org/version2/sample/abort.html>`_ instead of ``exit()``.

Access full logs
----------------

If you want to access the full logs you need to write ``-q`` and ``-v`` as
individual tox arguments and avoid combining them into a single one.
6 changes: 5 additions & 1 deletion src/tox/config/cli/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"""
from __future__ import annotations

import os
from contextlib import redirect_stderr
from pathlib import Path
from typing import TYPE_CHECKING, Callable, NamedTuple, Sequence, cast

Expand Down Expand Up @@ -45,7 +47,9 @@ def _get_base(args: Sequence[str]) -> tuple[int, ToxHandler, Source]:
tox_parser = ToxParser.base()
parsed = Parsed()
try:
tox_parser.parse_known_args(args, namespace=parsed)
with open(os.devnull, "w") as f:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have added a test for this to be fair 🤦

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was planning to, but time... 🤷🏽‍♂️

with redirect_stderr(f):
tox_parser.parse_known_args(args, namespace=parsed)
except SystemExit:
... # ignore parse errors, such as -va raises ignored explicit argument 'a'
guess_verbosity = parsed.verbosity
Expand Down