File tree 2 files changed +6
-3
lines changed
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
162
162
163
163
quote do
164
164
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
+
165
168
if unquote ( async ) do
169
+ @ moduletag async: true
166
170
ExUnit.Server . add_async_case ( __MODULE__ )
167
171
else
172
+ @ moduletag async: false
168
173
ExUnit.Server . add_sync_case ( __MODULE__ )
169
174
end
170
175
171
- Enum . each [ :ex_unit_tests , :tag , :moduletag ] ,
172
- & Module . register_attribute ( __MODULE__ , & 1 , accumulate: true )
173
-
174
176
@ before_compile ExUnit.Case
175
177
use ExUnit.Callbacks
176
178
end
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ defmodule ExUnit.CaseTest do
19
19
assert context [ :case ] == __MODULE__
20
20
assert context [ :test ] == __ENV__ . function |> elem ( 0 )
21
21
assert context [ :line ] == line
22
+ assert context [ :async ] == true
22
23
assert context [ :hello ] == true
23
24
assert context [ :world ] == :good
24
25
end
You can’t perform that action at this time.
0 commit comments