-
Notifications
You must be signed in to change notification settings - Fork 16
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
docstrings as a note #63
Comments
I have thought about this, though admittedly not very much! What you could do for now is pass your test method's docstring to the import marbles.core
class MyDocumentedTestCase(marbles.core.TestCase):
def test_foo(self):
'''Hi, Vincent!'''
self.assertTrue(False, note=self._testMethodDoc)
if __name__ == '__main__':
marbles.core.main() and when you run it you'll get:
One thing to keep in mind is that marbles respects the whitespace in When I come up with a more "unified" solution to this I'll reach out and ask you to give it a try :) |
ps. thanks again for having me! |
Assigning it to a note variable is a way to deal with it, sure. But what could I now put in the docstring that I wouldn't put in the note? What would one put in a note that one wouldn't put in a docstring? Let me know when you're considering a unification. I'd be interested in helping out. |
Sure. Could you add some more details about what behavior you'd like to see for docstrings and notes? e.g., "If I have a test method with docstring abc, I'd like to see output xyz" |
I would expect a failing test with verbose mode to show the doctoring of the method. |
Is your feature request related to a problem? Please describe.
This might be a thing in our team, but we really like docstrings. When a unit-test fails our current team relies on reliable docstrings to explain what is happening in a test. This is nice, because sometimes code is a language that is too cryptic to explain why a test is important
Describe the solution you'd like
I must admit that I'm just starting out with the project and there's parts that I love. I really enjoy the locals view in a failed test. But instead of notes, we might be interested in seeing the doctoring attached to the testing method. This might be a highly preferential thing on our team, but may just be worth considering.
Describe alternatives you've considered
Part of this problem could be explained with a note but a docstring feels like a more natural place to write a long part of text.
Additional context
This definitely falls into the nice-to-have category, something that one would only see if a certain flag is passed from the command line (like
--verbose
). We're curious what the thoughts are on your side.ps. Thanks again for speaking at PyData Amsterdam.
The text was updated successfully, but these errors were encountered: