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

support for [tool:pytest] given/other config files #1831

Closed
blueyed opened this issue Aug 21, 2016 · 6 comments
Closed

support for [tool:pytest] given/other config files #1831

blueyed opened this issue Aug 21, 2016 · 6 comments
Labels
status: help wanted developers would like help from experts on this topic type: enhancement new feature or API change, should be merged into features branch

Comments

@blueyed
Copy link
Contributor

blueyed commented Aug 21, 2016

With pytest -c setup.cfg the new [tool:pytest] section is not recognized.
I think it should be recognized for any config file (despite of its name/extension) that is passed in through -c. Ignoring the name here is important when using something like -c <(sed s/foo/bar/ setup.cfg) to pass in a temporary file (which won't have "setup.cfg" as its name).

Just add the following to a setup.cfg file and then run pytest -c setup.cfg:

[tool:pytest]
addopts = --meh

It won't complain about the unknown option --meh.

@blueyed blueyed added the type: bug problem that needs to be addressed label Aug 21, 2016
@RonnyPfannschmidt
Copy link
Member

right now tool:pytest is a special case only for setup.cfg coming in via autodiscovery

@RonnyPfannschmidt RonnyPfannschmidt added the type: enhancement new feature or API change, should be merged into features branch label Aug 21, 2016
@RonnyPfannschmidt RonnyPfannschmidt changed the title [tool:pytest] not recognized with -c setup.cfg support for [tool:pytest] given/other config files Aug 21, 2016
@RonnyPfannschmidt RonnyPfannschmidt removed the type: bug problem that needs to be addressed label Aug 21, 2016
@RonnyPfannschmidt RonnyPfannschmidt added the status: help wanted developers would like help from experts on this topic label Jan 18, 2017
@RonnyPfannschmidt
Copy link
Member

tox-dev/tox#225 we should add it for tox ini as well

@chebee7i
Copy link

This is a bug, right? The documentation does not indicate that support for [tool:pytest] is consulted only when the config file is auto-discovered.

https://docs.pytest.org/en/latest/example/pythoncollection.html#changing-naming-conventions

@RonnyPfannschmidt
Copy link
Member

@chebee7i its more of a change to enhance sanity - when it first was introduced it did the bad thing, and we want to change it to do a better thing

@chebee7i
Copy link

Agreed [tool:pytest] is an improvement. I was attempting to use it while also specifying a config file and was confused that it didn't work. The documentation doesn't mention that it only works for auto-discovered things, and that should be fixed...or the feature should be extended to manually specified configs as well.

@RonnyPfannschmidt
Copy link
Member

this has been implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted developers would like help from experts on this topic type: enhancement new feature or API change, should be merged into features branch
Projects
None yet
Development

No branches or pull requests

3 participants