@@ -1158,6 +1158,7 @@ def pytest_addoption(parser):
1158
1158
Unused when tests override the default value.""" ,
1159
1159
)
1160
1160
parser .addoption (
1161
+ "--lfp" ,
1161
1162
"--list-fail-page" ,
1162
1163
"--list-fail-pages" ,
1163
1164
action = "store_true" ,
@@ -1503,13 +1504,15 @@ def pytest_configure(config):
1503
1504
if (
1504
1505
"-n" in sys_argv
1505
1506
or " -n=" in arg_join
1507
+ or " -n" in arg_join
1506
1508
or "-c" in sys_argv
1507
1509
or (
1508
1510
python3
1509
1511
and "addopts" in config .inicfg .keys ()
1510
1512
and (
1511
1513
"-n=" in config .inicfg ["addopts" ]
1512
1514
or "-n " in config .inicfg ["addopts" ]
1515
+ or "-n" in config .inicfg ["addopts" ]
1513
1516
)
1514
1517
)
1515
1518
):
@@ -1594,6 +1597,21 @@ def pytest_configure(config):
1594
1597
if sb_config .save_screenshot and sb_config .no_screenshot :
1595
1598
sb_config .save_screenshot = False # "no_screenshot" has priority
1596
1599
1600
+ if (
1601
+ "-v" in sys_argv and not sb_config ._multithreaded
1602
+ or (
1603
+ python3
1604
+ and hasattr (config , "invocation_params" )
1605
+ and "-v" in config .invocation_params .args
1606
+ and (
1607
+ "-n=1" in config .invocation_params .args
1608
+ or "-n1" in config .invocation_params .args
1609
+ or "-n 1" in " " .join (config .invocation_params .args )
1610
+ )
1611
+ )
1612
+ ):
1613
+ sb_config .list_fp = True # List the fail pages in console output
1614
+
1597
1615
if (
1598
1616
sb_config ._multithreaded
1599
1617
and "--co" not in sys_argv
@@ -1808,7 +1826,11 @@ def pytest_runtest_teardown(item):
1808
1826
pass
1809
1827
except Exception :
1810
1828
pass
1811
- if sb_config ._has_exception and sb_config .list_fp and sb_config ._fail_page :
1829
+ if (
1830
+ (sb_config ._has_exception or python3_11_or_newer )
1831
+ and sb_config .list_fp
1832
+ and sb_config ._fail_page
1833
+ ):
1812
1834
sys .stderr .write ("\n => Fail Page: %s\n " % sb_config ._fail_page )
1813
1835
1814
1836
0 commit comments