OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How I can update the environment table in pytest-html

  • Thread starter Thread starter Meenu Garg
  • Start date Start date
M

Meenu Garg

Guest
I am trying to edit the default pytest-html report and want to update Environment table.

I need to add the rows for browser, Application URL and other variable in environment table and delete some default rows.

I have used to add extra variable in environment table

Code:
@pytest.fixture(autouse=True, scope='session')
def _environment(request):
    request.config._metadata['URL']=os.environ['url']

However when I add multiple metadata variable it throws an error

Code:
@pytest.fixture(autouse=True, scope='session')
def _environment(request):
    request.config._metadata['URL']=os.environ['url']
    request.config._metadata['Browser']=os.environ['browser']

Can anyone help me to achieve it
<p>I am trying to edit the default pytest-html report and want to update Environment table. </p>

<p>I need to add the rows for browser, Application URL and other variable in environment table and delete some default rows. </p>

<p>I have used to add extra variable in environment table</p>

<pre><code>@pytest.fixture(autouse=True, scope='session')
def _environment(request):
request.config._metadata['URL']=os.environ['url']
</code></pre>

<p>However when I add multiple metadata variable it throws an error</p>

<pre><code>@pytest.fixture(autouse=True, scope='session')
def _environment(request):
request.config._metadata['URL']=os.environ['url']
request.config._metadata['Browser']=os.environ['browser']
</code></pre>

<p>Can anyone help me to achieve it</p>
 

Latest posts

Top