
GITHUB . COM {
}
Detected CMS Systems:
- Wordpress (2 occurrences)
Title:
ValueError: no option named 'verbose' - during assertion eval, when Terminal plugin is disabled Β· Issue #9422 Β· pytest-dev/pytest
Description:
Execute pytest without the terminal plugin, i.e. pytest -p no:terminal -s, when the test contains an assertion failure, for example: def test_assert(): assert 1 == 2, "fail" An exception is issued: (https://github.com/pytest-dev/pytest/b...
Website Age:
17 years and 8 months (reg. 2007-10-09).
Matching Content Categories {π}
- Technology & Computing
- Transportation
- Real Estate
Content Management System {π}
What CMS is github.com built with?
Github.com uses WORDPRESS.
Traffic Estimate {π}
What is the average monthly size of github.com audience?
ππ Tremendous Traffic: 10M - 20M visitors per month
Based on our best estimate, this website will receive around 10,653,634 visitors per month in the current month.
check SE Ranking
check Ahrefs
check Similarweb
check Ubersuggest
check Semrush
How Does Github.com Make Money? {πΈ}
Subscription Packages {π³}
We've located a dedicated page on github.com that might include details about subscription plans or recurring payments. We identified it based on the word pricing in one of its internal links. Below, you'll find additional estimates for its monthly recurring revenues.How Much Does Github.com Make? {π°}
Subscription Packages {π³}
Prices on github.com are in US Dollars ($).
They range from $4.00/month to $21.00/month.
We estimate that the site has approximately 5,316,035 paying customers.
The estimated monthly recurring revenue (MRR) is $22,327,346.
The estimated annual recurring revenues (ARR) are $267,928,149.
Wordpress Themes and Plugins {π¨}
What WordPress theme does this site use?
It is strange but we were not able to detect any theme on the page.
What WordPress plugins does this website use?
It is strange but we were not able to detect any plugins on the page.
Keywords {π}
terminal, option, verbose, plugin, issue, plugins, commented, assertion, nicoddemus, default, pytest, builtin, configgetoptionverbose, output, call, added, member, add, good, kakumar, sign, named, disabled, noterminal, problem, topic, related, rewrite, type, config, ronnypfannschmidt, projects, valueerror, def, line, getoption, configoptionverbose, verbosity, setting, case, workaround, pluginmanager, exitcode, disabling, idea, navigation, source, pytestdev, fork, code,
Topics {βοΈ}
/pytest-dev/pytest/blob/main/src/_pytest/assertion/truncate /pytest-dev/pytest/blob/main/src/_pytest/assertion/util /pytest-dev/pytest/blob/main/src/_pytest/terminal pytest/src/_pytest/terminal e734f30 pierre-sassoulas mentioned _pytest/assertion/util source code _pytest/assertion/__init__ personal information valueerror terminal pytest adoption issue easy issue _pytest/config/__init__ execute pytest moving verbosity setting user-facing messages comment metadata assignees assertion rewriter plugin pathlib import path config import pytestpluginmanager assigned labels good break cli args type projects projects milestone terminal plugin disabled addressed type disable terminal plugin assertion failure getoption call works assertion eval assertion utils assertion failures contributor topic docs pytest pytest' option named { setting config rewrite related _pytest gtowers1 added increase verbosity valueerror errors topic good idea dir=path exit_code = run_pytest_cli terminal plugin terminal reporter good option def test_assert
Payment Methods {π}
- Braintree
Questions {β}
- Already have an account?
- What do you mean, add the default to the verbose definition?
- Would somebody like to give this a try?
Schema {πΊοΈ}
DiscussionForumPosting:
context:https://schema.org
headline:ValueError: no option named 'verbose' - during assertion eval, when Terminal plugin is disabled
articleBody:Execute `pytest` without the terminal plugin, i.e. `pytest -p no:terminal -s`, when the test contains an assertion failure, for example:
```
def test_assert():
assert 1 == 2, "fail"
```
An exception is issued:
(https://github.com/pytest-dev/pytest/blob/main/src/_pytest/assertion/util.py#L161)
```
_pytest/assertion/__init__.py", line 181, in pytest_assertrepr_compare
return util.assertrepr_compare(config=config, op=op, left=left, right=right)
_pytest/assertion/util.py", line 161, in assertrepr_compare
verbose = config.getoption("verbose")
_pytest/config/__init__.py", line 1484, in getoption
raise ValueError(f"no option named {name!r}") from e
ValueError: no option named 'verbose'
```
Additional reference to `config.option.verbose`: https://github.com/pytest-dev/pytest/blob/main/src/_pytest/assertion/truncate.py#L29
The `verbose` parameter is set alongside with the Terminal plugin (https://github.com/pytest-dev/pytest/blob/main/src/_pytest/terminal.py#L144), but apparently is used by the assertion utils as well.
Possible solution, moving `verbosity` setting from [terminal pytest adoption](https://github.com/pytest-dev/pytest/blob/main/src/_pytest/terminal.py#L114) to [runner pytest_adoption](https://github.com/pytest-dev/pytest/blob/main/src/_pytest/runner.py#L50) , since the verbosity setting affects modules outside the terminal output
----
Our specific use case: Disable Terminal Plugin and forward results using dedicated logger. We achieve it by implementing the following:
```
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
def pytest_runtest_makereport(item, call):
result = (yield).get_result()
if call.when == "call" or (call.when == "setup" and call.excinfo is not None):
test_id = None
if callspec := getattr(item, "callspec", None):
test_id = callspec.id
test_details = dict(test_name=item.name, test_id=test_id, passed=result.passed)
if call.excinfo is not None:
test_details.update(dict(type=call.excinfo.type.__name__, reason=str(call.excinfo.value)))
logger.exception("Test failed", extra=test_details, exc_info=call.excinfo.value)
else:
logger.info("Test Passed", extra=test_details)
```
Then we execute pytest with terminal plugin disabled. The problem occurs upon assertion failures and currently our workaround is setting `config.option.verbose` during the the `pytest_configure` on our end.
author:
url:https://github.com/yaelmi3
type:Person
name:yaelmi3
datePublished:2021-12-17T12:56:16.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:9
url:https://github.com/9422/pytest/issues/9422
context:https://schema.org
headline:ValueError: no option named 'verbose' - during assertion eval, when Terminal plugin is disabled
articleBody:Execute `pytest` without the terminal plugin, i.e. `pytest -p no:terminal -s`, when the test contains an assertion failure, for example:
```
def test_assert():
assert 1 == 2, "fail"
```
An exception is issued:
(https://github.com/pytest-dev/pytest/blob/main/src/_pytest/assertion/util.py#L161)
```
_pytest/assertion/__init__.py", line 181, in pytest_assertrepr_compare
return util.assertrepr_compare(config=config, op=op, left=left, right=right)
_pytest/assertion/util.py", line 161, in assertrepr_compare
verbose = config.getoption("verbose")
_pytest/config/__init__.py", line 1484, in getoption
raise ValueError(f"no option named {name!r}") from e
ValueError: no option named 'verbose'
```
Additional reference to `config.option.verbose`: https://github.com/pytest-dev/pytest/blob/main/src/_pytest/assertion/truncate.py#L29
The `verbose` parameter is set alongside with the Terminal plugin (https://github.com/pytest-dev/pytest/blob/main/src/_pytest/terminal.py#L144), but apparently is used by the assertion utils as well.
Possible solution, moving `verbosity` setting from [terminal pytest adoption](https://github.com/pytest-dev/pytest/blob/main/src/_pytest/terminal.py#L114) to [runner pytest_adoption](https://github.com/pytest-dev/pytest/blob/main/src/_pytest/runner.py#L50) , since the verbosity setting affects modules outside the terminal output
----
Our specific use case: Disable Terminal Plugin and forward results using dedicated logger. We achieve it by implementing the following:
```
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
def pytest_runtest_makereport(item, call):
result = (yield).get_result()
if call.when == "call" or (call.when == "setup" and call.excinfo is not None):
test_id = None
if callspec := getattr(item, "callspec", None):
test_id = callspec.id
test_details = dict(test_name=item.name, test_id=test_id, passed=result.passed)
if call.excinfo is not None:
test_details.update(dict(type=call.excinfo.type.__name__, reason=str(call.excinfo.value)))
logger.exception("Test failed", extra=test_details, exc_info=call.excinfo.value)
else:
logger.info("Test Passed", extra=test_details)
```
Then we execute pytest with terminal plugin disabled. The problem occurs upon assertion failures and currently our workaround is setting `config.option.verbose` during the the `pytest_configure` on our end.
author:
url:https://github.com/yaelmi3
type:Person
name:yaelmi3
datePublished:2021-12-17T12:56:16.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:9
url:https://github.com/9422/pytest/issues/9422
Person:
url:https://github.com/yaelmi3
name:yaelmi3
url:https://github.com/yaelmi3
name:yaelmi3
InteractionCounter:
interactionType:https://schema.org/CommentAction
userInteractionCount:9
interactionType:https://schema.org/CommentAction
userInteractionCount:9
External Links {π}(2)
Analytics and Tracking {π}
- Site Verification - Google
Libraries {π}
- Clipboard.js
- D3.js
- Lodash
Emails and Hosting {βοΈ}
Mail Servers:
- aspmx.l.google.com
- alt1.aspmx.l.google.com
- alt2.aspmx.l.google.com
- alt3.aspmx.l.google.com
- alt4.aspmx.l.google.com
Name Servers:
- dns1.p08.nsone.net
- dns2.p08.nsone.net
- dns3.p08.nsone.net
- dns4.p08.nsone.net
- ns-1283.awsdns-32.org
- ns-1707.awsdns-21.co.uk
- ns-421.awsdns-52.com
- ns-520.awsdns-01.net