File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -1752,6 +1752,7 @@ def pytest_runtest_setup(item):
1752
1752
return
1753
1753
if sb_config .dashboard :
1754
1754
sb_config ._sbase_detected = False
1755
+ sb_config ._fail_page = None
1755
1756
test_id , display_id = _get_test_ids_ (item )
1756
1757
sb_config ._test_id = test_id
1757
1758
sb_config ._latest_display_id = display_id
@@ -1818,7 +1819,22 @@ def pytest_runtest_teardown(item):
1818
1819
and sb_config .list_fp
1819
1820
and sb_config ._fail_page
1820
1821
):
1821
- sys .stderr .write ("\n => Fail Page: %s\n " % sb_config ._fail_page )
1822
+ if (
1823
+ "-s" in sys_argv
1824
+ or "--capture=no" in sys_argv
1825
+ or (
1826
+ hasattr (sb_config .pytest_config , "invocation_params" )
1827
+ and (
1828
+ "-s" in sb_config .pytest_config .invocation_params .args
1829
+ or "--capture=no" in (
1830
+ sb_config .pytest_config .invocation_params .args
1831
+ )
1832
+ )
1833
+ )
1834
+ ):
1835
+ print ("\n => Fail Page: %s" % sb_config ._fail_page )
1836
+ else :
1837
+ sys .stdout .write ("\n => Fail Page: %s\n " % sb_config ._fail_page )
1822
1838
1823
1839
1824
1840
def pytest_sessionfinish (session ):
You can’t perform that action at this time.
0 commit comments