@@ -148,11 +148,15 @@ def pytest_addoption(parser):
148148 mpl_hash_library_help = "json library of image hashes, relative to location where py.test is run"
149149 group .addoption ('--mpl-hash-library' , help = mpl_hash_library_help , action = 'store' )
150150 parser .addini ("mpl-hash-library" , help = mpl_hash_library_help )
151- group .addoption ('--mpl-generate-summary' , action = 'store' ,
152- help = "Generate a summary report of any failed tests"
153- ", in --mpl-results-path. The type of the report should be "
154- "specified. Supported types are `html`, `json` and `basic-html`. "
155- "Multiple types can be specified separated by commas." )
151+
152+ mpl_generate_summary_help = (
153+ "Generate a summary report of any failed tests"
154+ ", in --mpl-results-path. The type of the report should be "
155+ "specified. Supported types are `html`, `json` and `basic-html`. "
156+ "Multiple types can be specified separated by commas."
157+ )
158+ group .addoption ("--mpl-generate-summary" , help = mpl_generate_summary_help , action = "store" )
159+ parser .addini ("mpl-generate-summary" , help = mpl_generate_summary_help )
156160
157161 results_path_help = "directory for test results, relative to location where py.test is run"
158162 group .addoption ('--mpl-results-path' , help = results_path_help , action = 'store' )
@@ -199,7 +203,8 @@ def pytest_configure(config):
199203 results_dir = config .getoption ("--mpl-results-path" ) or config .getini ("mpl-results-path" )
200204 hash_library = config .getoption ("--mpl-hash-library" ) or config .getini ("mpl-hash-library" )
201205 _hash_library_from_cli = bool (config .getoption ("--mpl-hash-library" )) # for backwards compatibility
202- generate_summary = config .getoption ("--mpl-generate-summary" )
206+ generate_summary = (config .getoption ("--mpl-generate-summary" ) or
207+ config .getini ("mpl-generate-summary" ))
203208 results_always = (config .getoption ("--mpl-results-always" ) or
204209 config .getini ("mpl-results-always" ))
205210 use_full_test_name = (config .getoption ("--mpl-use-full-test-name" ) or
0 commit comments