@@ -56,14 +56,14 @@ def pytest_addoption(parser):
56
56
'that the report may not render or function where CSP '
57
57
'restrictions are in place (see '
58
58
'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 = [],
60
60
help = 'append given css file content to report style file.' )
61
61
62
62
63
63
def pytest_configure (config ):
64
64
htmlpath = config .getoption ('htmlpath' )
65
65
if htmlpath :
66
- for csspath in config .getoption ('css' ) or [] :
66
+ for csspath in config .getoption ('css' ):
67
67
open (csspath )
68
68
if not hasattr (config , 'slaveinput' ):
69
69
# prevent opening htmlpath on slave nodes (xdist)
@@ -329,7 +329,7 @@ def _generate_report(self, session):
329
329
self .style_css += '\n ' .join (ansi_css )
330
330
331
331
# <DF> Add user-provided CSS
332
- for path in self .config .getoption ('css' ) or [] :
332
+ for path in self .config .getoption ('css' ):
333
333
self .style_css += '\n /******************************'
334
334
self .style_css += '\n * CUSTOM CSS'
335
335
self .style_css += '\n * {}' .format (path )
0 commit comments