Pytest: Incorrect color of indicators in the test summary after test failed

Created on 7 Jul 2020  ·  2Comments  ·  Source: pytest-dev/pytest

From version PyTest 5.3.0+ (looks like due to https://github.com/pytest-dev/pytest/issues/6097) when one of @parametrize test fail, the others “[…%]” indicators in the test summary have red (failed) color.

Color_issue

Instance:

@pytest.mark.parametrize('example', range(10))
def test_test(example):
    if example == 3:
        assert False
    else:
        assert True

Pip:

Package                       Version  
----------------------------- ---------
attrs                         19.3.0   
backports.functools-lru-cache 1.6.1    
beautifulsoup4                4.9.1    
cachetools                    4.1.1    
certifi                       2020.6.20
chardet                       3.0.4    
colorama                      0.4.3    
configparser                  5.0.0    
crayons                       0.3.1    
cssselect                     1.1.0    
furl                          2.1.0    
future                        0.18.2   
google-auth                   1.18.0   
google-auth-oauthlib          0.4.1    
gspread                       3.6.0    
httplib2                      0.18.1   
idna                          2.10     
lxml                          4.5.1    
more-itertools                8.4.0    
numpy                         1.19.0   
oauth2client                  4.1.3    
oauthlib                      3.1.0    
orderedmultidict              1.0.1    
packaging                     20.4     
Pillow                        7.2.0    
pip                           20.0.2   
pluggy                        0.13.1   
py                            1.9.0    
pyasn1                        0.4.8    
pyasn1-modules                0.2.8    
pyparsing                     2.4.7    
pyquery                       1.4.1    
pytest                        5.4.3    
requests                      2.24.0   
requests-oauthlib             1.3.0    
rsa                           4.6      
selene                        1.0.2    
selenium                      3.141.0  
setuptools                    46.0.0   
six                           1.15.0   
soupsieve                     2.0.1    
urllib3                       1.25.9   
wcwidth                       0.2.5    
webdriver-manager             3.2.1    
wheel                         0.34.2
question

Most helpful comment

As far as I know, this is intended - for longer testsuites with a lot of output, it's quite nice to see whether something failed but already scrolled off the screen.

All 2 comments

As far as I know, this is intended - for longer testsuites with a lot of output, it's quite nice to see whether something failed but already scrolled off the screen.

Yep, this is the intended behaviour... though it does look a little odd in verbose mode :sweat_smile:

Was this page helpful?
0 / 5 - 0 ratings