In pytest-runner 2, I adapted pytest-runner to support the 'pytest' distutils command. However, because the pytest project itself uses the
[pytest] section of setup.cfg, that conflicts with the same section for the 'pytest' distutils command.
Using the 'pytest' distutils command in a project which specifies, for example, 'norecursedirs', the runner will fail because the pytest-runner distutils command doesn't recognize that parameter (or any other ini options). An example error message is:
error: error in setup.cfg: command 'PyTest' has no such option 'norecursedirs'
I see a few options here:
- Just use the 'ptr' command name.
- Have pytest runner distutils command disregard all unrecognized options.
- Have pytest runner distutils command implement and ignore all of the options that might be presented in setup.cfg. It would need to do this before pytest is present (because args are processed before dependencies such as pytest are downloaded/imported).
- Have pytest drop support for setup.cfg.
- Require that users not use setup.cfg for pytest ini options (only support pytest.ini and tox.ini for pytest options when running under distutils).
I suspect there are other options, too. I'm not particularly happy with any of those options, but I'm leaning toward (2).
I've filed the ticket here with pytest for two reasons:
- I want the implementation to be as acceptable as possible for the pytest project to endorse it as a viable integration mechanism.
- I believe the use of the [pytest] section in the setup.cfg by the pytest library is a violation of the explicit expectation that those sections are meant for distutils commands.
@hpk42 What is your reaction? What would you suggest?