I ran in to an issue filling in the environment fields on Allure reports for pytest. The issue was, the environment field was not being filled in correctly when the report was generated.

I tried a couple of different things, and this is what wound up working.

# Drop in to conftest.py
import allure

def pytest_configure(config):  
        browser=u'Google Chrome',

I'm guessing the reason is, is because the pytest_configure method gets ran multiple times and the initial setting of those values is lost in the process.

Side note - Any custom kwargs you use will appear in the report also.

© 2019. All Rights Reserved.