Skip to content

Commit

Permalink
Add info about private members in tests. (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
adiroiban committed Nov 6, 2017
1 parent 49a9f21 commit 016784c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/programming/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ Developing using tests

As there is no guarantee for the order in which the tests will execute there is
one major requirement, regardless of the test type.
The *test should not have any side effect* as the order of execution is random.
The *test should not have any side effect*.

When writing application code, only write enough code to make a test work.
It helps you to realise when to stop coding and move on to the next task.
Expand Down Expand Up @@ -581,6 +581,7 @@ part for a test: the cleanup.
It is recommended to do it in tearDown() but
when not practical, do it as a new paragraph, at the end of the test.


Smells
======

Expand Down Expand Up @@ -635,6 +636,10 @@ Naming conventions
* If testing a specific method, include the exact name of the method, in the
test name, at the beginning, just after the `test_` marker.

* Only use private members when they are used by a single test.
Any code which is used by multiple tests should be public and with
comprehensive documentation.

* When there are multiple tests for the same method, suffix the test with
a short underline ("_") delimited summary.
No need to add all details in the name.
Expand Down

0 comments on commit 016784c

Please sign in to comment.