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

docstring: Add decorator to format the docstrings #33

Merged
merged 1 commit into from
Aug 11, 2015

Conversation

domidimi
Copy link
Contributor

Some test frameworks like nose use the docstring to output information
about a test. In the case of generated tests all of them would get the
same description. Format the docstring for each generated test function using the test values.

Example:

@DaTa(1,2)
def test_A(value):
"""Test A for value {}"""
...

executed with "nosetests -v", will output:
Test A for value 1
Test A for value 2

Signed-off-by: [email protected]

@landscape-bot
Copy link

Code Health
Code quality remained the same when pulling d9536a4 on domidimi:master into 9e9998b on txels:master.

@txels
Copy link
Collaborator

txels commented Aug 5, 2015

Thanks for this. Apologies for the delay. Looks good.

I am wondering whether formatting the docs should be the default behaviour, and we could do without the need for an extra decorator. What do you think?

@domidimi
Copy link
Contributor Author

domidimi commented Aug 9, 2015

I think it is a good idea to make it the default behaviour. I'll try to find some time and adapt the patch this week.

Some test frameworks like nose use the docstring to output information
about a test. In the case of generated tests all of them would get the
same description. Format of the docstring for each generated test
function using the test values.

Example:

@DaTa(1,2)
def test_A(value):
    """Test A for value {}"""
    ...

executed with "nosetests -v", will output:
Test A for value 1
Test A for value 2

Signed-off-by: [email protected]
@landscape-bot
Copy link

Code Health
Code quality remained the same when pulling 26b7752 on domidimi:master into 9e9998b on txels:master.

txels added a commit that referenced this pull request Aug 11, 2015
docstring: Add decorator to format the docstrings
@txels txels merged commit 7ca1ad2 into datadriventests:master Aug 11, 2015
@txels
Copy link
Collaborator

txels commented Aug 11, 2015

Thanks!

@domidimi
Copy link
Contributor Author

Thank you too.

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.

3 participants