File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -162,15 +162,17 @@ defmodule ExUnit.Case do
162162
163163 quote do
164164 unless Module . get_attribute ( __MODULE__ , :ex_unit_tests ) do
165+ Enum . each [ :ex_unit_tests , :tag , :moduletag ] ,
166+ & Module . register_attribute ( __MODULE__ , & 1 , accumulate: true )
167+
165168 if unquote ( async ) do
169+ @ moduletag async: true
166170 ExUnit.Server . add_async_case ( __MODULE__ )
167171 else
172+ @ moduletag async: false
168173 ExUnit.Server . add_sync_case ( __MODULE__ )
169174 end
170175
171- Enum . each [ :ex_unit_tests , :tag , :moduletag ] ,
172- & Module . register_attribute ( __MODULE__ , & 1 , accumulate: true )
173-
174176 @ before_compile ExUnit.Case
175177 use ExUnit.Callbacks
176178 end
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ defmodule ExUnit.CaseTest do
1919 assert context [ :case ] == __MODULE__
2020 assert context [ :test ] == __ENV__ . function |> elem ( 0 )
2121 assert context [ :line ] == line
22+ assert context [ :async ] == true
2223 assert context [ :hello ] == true
2324 assert context [ :world ] == :good
2425 end
You can’t perform that action at this time.
0 commit comments