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

Keep explicit newlines with help texts #256

Merged
merged 3 commits into from
Feb 25, 2020
Merged

Conversation

blueyed
Copy link
Owner

@blueyed blueyed commented Feb 25, 2020

This makes a difference for e.g. pytest-xdist:

Before:

--dist=distmode       set mode for distributing tests to exec
environments. each: …
                      available environment. loadscope: …
                      grouped by file to any available environment.
(default) no: …

After:

--dist=distmode       set mode for distributing tests to exec
environments.
                      each: send each test to all available environments.
                      load: load balance by sending any pending test to
any available environment.
                      …
                      (default) no: run tests inprocess, don't distribute.

This might also result in unexpected changes (hard wrapping), when line
endings where used unintentionally, e.g. with:

  some long
  help text
  """

But the benefits from that are worth it, and it is easy to fix, as will be
done for the internal assertmode option.

Upstreamed: pytest-dev#6817

This makes a difference for e.g. pytest-xdist:

Before:
```
  --dist=distmode       set mode for distributing tests to exec environments. each: …
                        available environment. loadscope: …
                        grouped by file to any available environment. (default) no: …
```

After:
```
  --dist=distmode       set mode for distributing tests to exec environments.
                        each: send each test to all available environments.
                        load: load balance by sending any pending test to any available environment.
                        …
                        (default) no: run tests inprocess, don't distribute.
```

This might also result in unexpected changes (hard wrapping), when line
endings where used unintentionally, e.g. with:

```
help="""
    some long
    help text
    """
```

But the benefits from that are worth it, and it is easy to fix, as will
be done for the internal `assertmode` option.
blueyed added a commit to blueyed/testmon that referenced this pull request Feb 25, 2020
This is not relevant currently (i.e. causes no change), but I've changed
it in blueyed/pytest#256 to split on newlines
before wrapping it.
@blueyed blueyed merged commit f04a8f8 into my-master Feb 25, 2020
@blueyed blueyed deleted the argparsing-_split_lines branch February 25, 2020 15:00
tarpas pushed a commit to tarpas/pytest-testmon that referenced this pull request Feb 16, 2021
This is not relevant currently (i.e. causes no change), but I've changed
it in blueyed/pytest#256 to split on newlines
before wrapping it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant