Pytest: captured stderr setup and captured log setup duplicated

1.1k views Asked by At

enter image description here

As shown on the screenshot above: my pytest-html report gives me both "Captured stdout setup" and "Captured log setup" when driver instance is created. Is there a way to turn it off so it's not redundant?

 -----------------------------Captured stdout setup------------------------------ 
 

 -----------------------------Captured stderr setup------------------------------ 
[WDM] - Current google-chrome version is 87.0.4280
[WDM] - Get LATEST driver version for 87.0.4280
[WDM] - Driver [C:\Users\olga\.wdm\drivers\chromedriver\win32\87.0.4280.88\chromedriver.exe] found in cache

 -------------------------------Captured log setup------------------------------- 
INFO     WDM:logger.py:24 Current google-chrome version is 87.0.4280
INFO     WDM:logger.py:14 Get LATEST driver version for 87.0.4280
INFO     WDM:logger.py:14 Driver [C:\Users\olga\.wdm\drivers\chromedriver\win32\87.0.4280.88\chromedriver.exe] found in cache
1

There are 1 answers

0
justMe On

Kind of a workaround but solved my problem:

I moved creating the driver instance and using the fixture to a separate file Base Test - and my test class inherits it instead of using @pytest.usefixtures decorator

import pytest
@pytest.mark.usefixtures("driver_setup")
class BaseTest:
    pass