Skip to content

Commit 1f3b022

Browse files
axelsonjosevalim
authored andcommitted
Improve ExUnit seed docs (#10962)
Make it more obvious what a seed of 0 does.
1 parent f82f2c7 commit 1f3b022

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Diff for: lib/ex_unit/lib/ex_unit.ex

+3-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,9 @@ defmodule ExUnit do
274274
* `:seed` - an integer seed value to randomize the test suite. This seed
275275
is also mixed with the test module and name to create a new unique seed
276276
on every test, which is automatically fed into the `:rand` module. This
277-
provides randomness between tests, but predictable and reproducible results;
277+
provides randomness between tests, but predictable and reproducible
278+
results. A `:seed` of `0` will disable randomization and the tests in each
279+
file will always run in the order that they were defined in;
278280
279281
* `:slowest` - prints timing information for the N slowest tests. Running
280282
ExUnit with slow test reporting automatically runs in `trace` mode. It

Diff for: lib/mix/lib/mix/tasks/test.ex

+2-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ defmodule Mix.Tasks.Test do
159159
* `--raise` - raises if the test suite failed
160160
161161
* `--seed` - seeds the random number generator used to randomize the order of tests;
162-
`--seed 0` disables randomization
162+
`--seed 0` disables randomization so the tests in a single file will always be ran
163+
in the same order they were defined in
163164
164165
* `--slowest` - prints timing information for the N slowest tests.
165166
Automatically sets `--trace` and `--preload-modules`

0 commit comments

Comments
 (0)