@@ -196,6 +196,37 @@ defmodule ExUnit.Case do
196196
197197 * `:tmp_dir` - (since v1.11.0) see the "Tmp Dir" section below
198198
199+ ## Filters
200+
201+ Tags can also be used to identify specific tests, which can then
202+ be included or excluded using filters. The most common functionality
203+ is to exclude some particular tests from running, which can be done
204+ via `ExUnit.configure/1`:
205+
206+ # Exclude all external tests from running
207+ ExUnit.configure(exclude: [external: true])
208+
209+ From now on, ExUnit will not run any test that has the `:external` option
210+ set to `true`. This behaviour can be reversed with the `:include` option
211+ which is usually passed through the command line:
212+
213+ $ mix test --include external:true
214+
215+ Run `mix help test` for more information on how to run filters via Mix.
216+
217+ Another use case for tags and filters is to exclude all tests that have
218+ a particular tag by default, regardless of its value, and include only
219+ a certain subset:
220+
221+ ExUnit.configure(exclude: :os, include: [os: :unix])
222+
223+ A given include/exclude filter can be given more than once:
224+
225+ ExUnit.configure(exclude: [os: :unix, os: :windows])
226+
227+ Keep in mind that all tests are included by default, so unless they are
228+ excluded first, the `include` option has no effect.
229+
199230 ## Parameterized tests
200231
201232 Sometimes you want to run the same tests but with different parameters.
@@ -231,37 +262,6 @@ defmodule ExUnit.Case do
231262 may be the wrong solution to your problem. Consider creating separated
232263 tests and sharing logic between them using regular functions
233264
234- ## Filters
235-
236- Tags can also be used to identify specific tests, which can then
237- be included or excluded using filters. The most common functionality
238- is to exclude some particular tests from running, which can be done
239- via `ExUnit.configure/1`:
240-
241- # Exclude all external tests from running
242- ExUnit.configure(exclude: [external: true])
243-
244- From now on, ExUnit will not run any test that has the `:external` option
245- set to `true`. This behaviour can be reversed with the `:include` option
246- which is usually passed through the command line:
247-
248- $ mix test --include external:true
249-
250- Run `mix help test` for more information on how to run filters via Mix.
251-
252- Another use case for tags and filters is to exclude all tests that have
253- a particular tag by default, regardless of its value, and include only
254- a certain subset:
255-
256- ExUnit.configure(exclude: :os, include: [os: :unix])
257-
258- A given include/exclude filter can be given more than once:
259-
260- ExUnit.configure(exclude: [os: :unix, os: :windows])
261-
262- Keep in mind that all tests are included by default, so unless they are
263- excluded first, the `include` option has no effect.
264-
265265 ## Log Capture
266266
267267 ExUnit can optionally suppress printing of log messages that are generated
0 commit comments