File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -1360,19 +1360,20 @@ def _warn_about_missing_assertion(self, mode: str) -> None:
1360
1360
if not _assertion_supported ():
1361
1361
from _pytest .warnings import _issue_warning_captured
1362
1362
1363
- warning_text = (
1364
- "assertions not in test modules or"
1365
- " plugins will be ignored"
1366
- " because assert statements are not executed "
1367
- "by the underlying Python interpreter "
1368
- "(are you using python -O?)\n "
1369
- )
1370
1363
if mode == "plain" :
1371
1364
warning_text = (
1372
1365
"ASSERTIONS ARE NOT EXECUTED"
1373
1366
" and FAILING TESTS WILL PASS. Are you"
1374
1367
" using python -O?"
1375
1368
)
1369
+ else :
1370
+ warning_text = (
1371
+ "assertions not in test modules or"
1372
+ " plugins will be ignored"
1373
+ " because assert statements are not executed "
1374
+ "by the underlying Python interpreter "
1375
+ "(are you using python -O?)\n "
1376
+ )
1376
1377
_issue_warning_captured (
1377
1378
PytestConfigWarning (warning_text ), self .hook , stacklevel = 2 ,
1378
1379
)
You can’t perform that action at this time.
0 commit comments