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

#2574 Options --fixtures and --fixtures-per-test keep indentation of docstrings #2575

Merged
merged 3 commits into from Jul 17, 2017

Conversation

MartinAltmayer
Copy link
Contributor

@MartinAltmayer MartinAltmayer commented Jul 15, 2017

Thanks for submitting a PR, your contribution is really appreciated!

Here's a quick checklist that should be present in PRs:

  • Add a new news fragment into the changelog folder
    • name it $issue_id.$type for example (588.bug)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of removal, feature, bugfix, vendor, doc or trivial
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."
  • Target: for bugfix, vendor, doc or trivial fixes, target master; for removals or features target features;
  • Make sure to include reasonable tests for your change if necessary

Unless your change is a trivial or a documentation fix (e.g., a typo or reword of a small section) please:

  • Add yourself to AUTHORS;

@MartinAltmayer
Copy link
Contributor Author

Note that it is not possible to keep indentation in all cases. In particular the following docstrings are equal at runtime, although the indentation of the second line within the docstring differs:

class TestClass:
    @pytest.fixture(scope="module")
    def fix1(request):
        """This is a fixture. Use it like this:
        
        I am not indented."""
    

@pytest.fixture(scope="module")
def fix2(request):
    """This is a fixture. Use it like this:
    
        I am indented"""

@coveralls
Copy link

Coverage Status

Coverage increased (+0.008%) to 92.136% when pulling 2a97979 on MartinAltmayer:master into 3578f4e on pytest-dev:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.008%) to 92.136% when pulling cc39f41 on MartinAltmayer:master into 3578f4e on pytest-dev:master.

@nicoddemus
Copy link
Member

Thanks a ton! 👍

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

4 participants