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

[pytest runner] re-add --options flag as a shlexed list of strings #5790

Merged
merged 2 commits into from May 8, 2018

Conversation

Projects
None yet
2 participants
@baroquebobcat
Copy link
Contributor

baroquebobcat commented May 7, 2018

Problem

--options was removed from pytest when cleaning up some issues with passthrough args (#5594). This made it more difficult to pass arbitrary args for pytest runs for automated use cases or to have options set in pants.ini. It makes it more difficult because now those options must be collated and appended to the end of the command in all cases. If the command construction code splits up how different flags are populated, it can be difficult to ensure that a particular flag's contents always ends up at the end.

Solution

Bring back the options flag, but only shlex it and not the passthrough args.

@baroquebobcat baroquebobcat requested review from stuhood and jsirois May 7, 2018

@stuhood

stuhood approved these changes May 7, 2018

Copy link
Member

stuhood left a comment

Thanks.

@@ -109,7 +110,7 @@ def register_options(cls, register):
"emitted to that file (prefix). Note that tests may run in a different cwd, so "
"it's best to use an absolute path to make it easy to find the subprocess "
"profiles later.")

register('--options', type=list, fingerprint=True, help='Pass these options to pytest.')

This comment has been minimized.

@stuhood

stuhood May 7, 2018

Member

Perhaps helpful to point out that passthrough args are supported for this option.

@baroquebobcat baroquebobcat merged commit de51e16 into pantsbuild:master May 8, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment