Skip to content

Commit d988327

Browse files
committed
ENH: Add results directory as setup.cfg option as well.
1 parent 1ba93fc commit d988327

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pytest_mpl/plugin.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ def pytest_addoption(parser):
7070
help="directory to generate reference images in, relative to location where py.test is run", action='store')
7171
group.addoption('--mpl-baseline-path',
7272
help="directory containing baseline images, relative to location where py.test is run", action='store')
73-
group.addoption('--mpl-results-path',
74-
help="directory for test results, relative to location where py.test is run", action='store')
73+
74+
results_path_help = "directory for test results, relative to location where py.test is run"
75+
group.addoption('--mpl-results-path', help=results_path_help, action='store')
76+
parser.addini('mpl-results-path', help=results_path_help)
7577

7678

7779
def pytest_configure(config):
@@ -80,7 +82,7 @@ def pytest_configure(config):
8082

8183
baseline_dir = config.getoption("--mpl-baseline-path")
8284
generate_dir = config.getoption("--mpl-generate-path")
83-
results_dir = config.getoption("--mpl-results-path")
85+
results_dir = config.getoption("--mpl-results-path") or config.getini("mpl-results-path")
8486

8587
if generate_dir is not None:
8688
if baseline_dir is not None:

0 commit comments

Comments
 (0)