mattjegan/django-gamification

Add docstrings to tests

mattjegan opened this issue · 5 comments

The current tests require previous knowledge of the code base to understand what we are testing for. By including docstrings we make the codebase more welcoming to future contributors and decrease the risk of creating regressions.

A docstring is a way to document within the Python code. For example, given this fake test:

1. def test_sum():
2.     """Tests that the sum() function gives correct mathematical output"""
3.     assert sum([1, 2]) == 3
4.     assert sum([]) == 0

you can see the docstring on line 2, which explains what the test is aiming to test. To complete this, we'd want to have docstrings for each test_ method in our test files.

Can I take this up? I'll require a bit guidance with what the tests are for and what kind...

Sure, no worries 😄

i dont understand do i make an .md file? i made one and renamed it to .rst ...lost the structure and all :|

Can I work on this too?

Sure @7Orion7, @tulikavijay is working on it at the moment but anyone is welcome to work together.