8000 Merge pull request #5658 from endolith/patch-1 · numpy/numpy@8e026a2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8e026a2

Browse files
committed
Merge pull request #5658 from endolith/patch-1
DOC: Add note about random seeds for unit testing
2 parents 0650e63 + 0784049 commit 8e026a2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

doc/TESTS.rst.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,3 +374,13 @@ at the end of the test run. Skipped tests are marked as ``'S'`` in
374374
the test results (or ``'SKIPPED'`` for ``verbose > 1``), and known
375375
failing tests are marked as ``'K'`` (or ``'KNOWN'`` if ``verbose >
376376
1``).
377+
378+
Tests on random data
379+
--------------------
380+
381+
Tests on random data are good, but since test failures are meant to expose
382+
new bugs or regressions, a test that passes most of the time but fails
383+
occasionally with no code changes is not helpful. Make the random data
384+
deterministic by setting the random number seed before generating it. Use
385+
either Python's ``random.seed(some_number)`` or Numpy's
386+
``numpy.random.seed(some_number)``, depending on the source of random numbers.

0 commit comments

Comments
 (0)
0