change if else structure of _warn_bout_missing_assertion
This commit is contained in:
parent
72a39117a8
commit
c39655725a
|
@ -1360,6 +1360,13 @@ class Config:
|
||||||
if not _assertion_supported():
|
if not _assertion_supported():
|
||||||
from _pytest.warnings import _issue_warning_captured
|
from _pytest.warnings import _issue_warning_captured
|
||||||
|
|
||||||
|
if mode == "plain":
|
||||||
|
warning_text = (
|
||||||
|
"ASSERTIONS ARE NOT EXECUTED"
|
||||||
|
" and FAILING TESTS WILL PASS. Are you"
|
||||||
|
" using python -O?"
|
||||||
|
)
|
||||||
|
else:
|
||||||
warning_text = (
|
warning_text = (
|
||||||
"assertions not in test modules or"
|
"assertions not in test modules or"
|
||||||
" plugins will be ignored"
|
" plugins will be ignored"
|
||||||
|
@ -1367,12 +1374,6 @@ class Config:
|
||||||
"by the underlying Python interpreter "
|
"by the underlying Python interpreter "
|
||||||
"(are you using python -O?)\n"
|
"(are you using python -O?)\n"
|
||||||
)
|
)
|
||||||
if mode == "plain":
|
|
||||||
warning_text = (
|
|
||||||
"ASSERTIONS ARE NOT EXECUTED"
|
|
||||||
" and FAILING TESTS WILL PASS. Are you"
|
|
||||||
" using python -O?"
|
|
||||||
)
|
|
||||||
_issue_warning_captured(
|
_issue_warning_captured(
|
||||||
PytestConfigWarning(warning_text), self.hook, stacklevel=2,
|
PytestConfigWarning(warning_text), self.hook, stacklevel=2,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue