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

Using positional arg/dir outside of PWD does not load options from explicit plugin #1594

Closed
blueyed opened this issue Jun 7, 2016 · 2 comments
Closed

Comments

@blueyed
Copy link
Contributor

@blueyed blueyed commented Jun 7, 2016

py.test -p project.lock8.plugin /tmp project --custom-option fails with

py.test: error: unrecognized arguments: --custom-option

The option is defined through pytest_addoption and parser.addoption therein.

Using an additional directory outside of $PWD seems to cause this.

I have tried using --confcutdir=$PWD, but it still did not work.

pytest 2.9.3.dev0 (current master).

@blueyed
Copy link
Contributor Author

@blueyed blueyed commented Jun 14, 2016

Regarding the testmon issue I've noticed that it also happens with py.test -c setup.cfg --my-custom-option http://localhost:9001/, but not when using an equal sign with the option: py.test -c setup.cfg --my-custom-option=http://localhost:9001/.

Please note that using the -c setup.cfg option here triggers the testmon issue, although py.test uses the same inifile when not specifying it.

rootdir: /path/to/project, inifile: setup.cfg
plugins: xdist-1.15.dev9+ngba35a3d, testmon-0.8.2, mock-1.1, asyncio-0.4.1, catchlog-1.2.2, random-0.2, incremental-0.4.2, notifier-0.2, cov-2.2.1, profiling-1.1.1, pylama-7.0.9, django-2.9.
1, instafail-0.3.0, bpdb-0.1.4

The custom option is added in project/app/plugin.py, which is loaded via setup.cfg:

addopts = --reuse-db --tb=short --dc=Tester -ra -p project.app.plugin --nomigrations
def pytest_addoption(parser):
    parser.addoption('--my-custom-option', action='store', default=None, help='…')
@blueyed blueyed mentioned this issue Jun 25, 2016
0 of 6 tasks complete
@nicoddemus
Copy link
Member

@nicoddemus nicoddemus commented Aug 6, 2016

Resolved in #1621

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.