diff --git a/lib/ex_unit/lib/ex_unit/doc_test.ex b/lib/ex_unit/lib/ex_unit/doc_test.ex index 90d3755aaa8..83d900245da 100644 --- a/lib/ex_unit/lib/ex_unit/doc_test.ex +++ b/lib/ex_unit/lib/ex_unit/doc_test.ex @@ -264,7 +264,7 @@ defmodule ExUnit.DocTest do {tests, fun_arities} -> {[test | tests], [test.fun_arity | fun_arities]} end - case only -- fun_arities do + case only -- [:moduledoc | fun_arities] do [] -> filtered_tests diff --git a/lib/ex_unit/test/ex_unit/doc_test_test.exs b/lib/ex_unit/test/ex_unit/doc_test_test.exs index 9e7faf47483..704bca7d7b6 100644 --- a/lib/ex_unit/test/ex_unit/doc_test_test.exs +++ b/lib/ex_unit/test/ex_unit/doc_test_test.exs @@ -462,7 +462,10 @@ defmodule ExUnit.DocTestTest do # doctest ExUnit.DocTest doctest ExUnit.DocTestTest.GoodModule, import: true - doctest ExUnit.DocTestTest.SomewhatGoodModuleWithOnly, only: [one: 0], import: true + + doctest ExUnit.DocTestTest.SomewhatGoodModuleWithOnly, + only: [:moduledoc, one: 0], + import: true doctest ExUnit.DocTestTest.SomewhatGoodModuleWithExcept, except: [:moduledoc, two: 0],