@@ -56,14 +56,14 @@ def pytest_addoption(parser):
5656 'that the report may not render or function where CSP '
5757 'restrictions are in place (see '
5858 'https://developer.mozilla.org/docs/Web/Security/CSP)' )
59- group .addoption ('--css' , action = 'append' , metavar = 'path' ,
59+ group .addoption ('--css' , action = 'append' , metavar = 'path' , default = [],
6060 help = 'append given css file content to report style file.' )
6161
6262
6363def pytest_configure (config ):
6464 htmlpath = config .getoption ('htmlpath' )
6565 if htmlpath :
66- for csspath in config .getoption ('css' ) or [] :
66+ for csspath in config .getoption ('css' ):
6767 open (csspath )
6868 if not hasattr (config , 'slaveinput' ):
6969 # prevent opening htmlpath on slave nodes (xdist)
@@ -329,7 +329,7 @@ def _generate_report(self, session):
329329 self .style_css += '\n ' .join (ansi_css )
330330
331331 # <DF> Add user-provided CSS
332- for path in self .config .getoption ('css' ) or [] :
332+ for path in self .config .getoption ('css' ):
333333 self .style_css += '\n /******************************'
334334 self .style_css += '\n * CUSTOM CSS'
335335 self .style_css += '\n * {}' .format (path )
0 commit comments