Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make options more consistent #61

Open
astrofrog opened this issue Oct 11, 2017 · 7 comments
Open

Make options more consistent #61

astrofrog opened this issue Oct 11, 2017 · 7 comments

Comments

@astrofrog
Copy link
Collaborator

Some options are available only through the decorator (e.g. the style), while some are accessible as command-line options and one (the results dir) is also an ini option. We should make this more consistent so that e.g. styles can be set globally on the command-line or in an ini file.

@astrofrog
Copy link
Collaborator Author

@dopplershift - could you explain why you added mpl-results-path as an ini option in addition to a command-line option? I started adding other options as ini options but then noticed that most other plugins don't really do this, so I was wondering whether we even need ini options at all?

@dopplershift
Copy link
Contributor

I like the ini options because it lets me put our standard workflow in setup.cfg, and then running our tests is just pytest or python setup.py test.

@astrofrog
Copy link
Collaborator Author

You don't need the ini option to use setup.cfg though since you could also add any option to the [pytest] section in setup.cfg anyway?

@dopplershift
Copy link
Contributor

I have mpl-results-path listed under [tool:pytest] currently. I was under the impression that this didn't work until I added the ini section support for it. Am I mistaken?

@astrofrog
Copy link
Collaborator Author

@dopplershift - I have to double check, but I know for sure you can do:

[tool:pytest]
addopts = --mpl

without the ini.

@dopplershift
Copy link
Contributor

I didn't know about addopts. That seems to work fine for my cases, so I'm ok with removing the direct ini options.

@dopplershift
Copy link
Contributor

Ok, here's one reservation I have after working with addopts. The ini option specific to pytest-mpl is ignored if pytest-mpl isn't installed, whereas the addopts is always on. This produces errors if pytest-mpl isn't installed.

@ConorMacBride ConorMacBride added this to the 1.0.0 milestone Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants