AguaClara / aguaclara_tutorial

This repository is for all team members to find information and tutorials about useful tools like Python, Atom, Hydrogen, GitHub, and report writing.
https://aguaclara.github.io/aguaclara_tutorial/
3 stars 75 forks source link

Implement doctest team wide #17

Closed eak24 closed 6 years ago

eak24 commented 6 years ago

@kevinjuan25 I think we should implement doc testing team-wide. I think it would be useful to any teams that are trying to make functions that are reusable.

What is doctesting, you ask??

check out the following function:

def add(a,b):
    """
    >>> add(5,10)
    15
    """
    return a+b

Notice the >>> in the docstring? This indicates that the user could put it into their python interpreter and get the immediately following response. Doctest automates this, ensuring the documentation is up to spec. And it's a simple way to test code. Please see my gist about it. And please try it out! Also, we should insist teams are using it ASAP.

Also could you add a section about it in your tutorial?

Thanks!!!

kevinjuan25 commented 6 years ago

@ethan92429 Sounds like a great idea! I'll add it to the tutorial as soon as I can, and we'll make sure all teams make use of it.

kevinjuan25 commented 6 years ago

@ethan92429 See first draft of doctest in the wiki and provide feedback please.

eak24 commented 6 years ago

Hey @kevinjuan25 this looks great! Just looked it over. Thanks for writing it up so quickly!