@@ -15,7 +15,9 @@ defmodule Wallaby.Feature do
1515 ```
1616 """
1717
18- defmacro __using__ ( _ ) do
18+ defmacro __using__ ( opts \\ [ ] ) do
19+ use_sandbox? = Keyword . get ( opts , :sandbox , true )
20+
1921 quote do
2022 ExUnit.Case . register_attribute ( __MODULE__ , :sessions )
2123
@@ -24,7 +26,8 @@ defmodule Wallaby.Feature do
2426
2527 setup context do
2628 if context [ :test_type ] == :feature do
27- metadata = unquote ( __MODULE__ ) . Utils . maybe_checkout_repos ( context [ :async ] )
29+ metadata =
30+ unquote ( __MODULE__ ) . Utils . maybe_checkout_repos ( unquote ( use_sandbox? ) , context [ :async ] )
2831
2932 start_session_opts =
3033 [ metadata: metadata ]
@@ -171,13 +174,15 @@ defmodule Wallaby.Feature do
171174 def put_create_session_fn ( opts , func ) , do: Keyword . put ( opts , :create_session_fn , func )
172175
173176 if @ includes_ecto do
174- def maybe_checkout_repos ( async? ) do
177+ def maybe_checkout_repos ( true , async? ) do
175178 otp_app ( )
176179 |> ecto_repos ( )
177180 |> Enum . map ( & checkout_ecto_repos ( & 1 , async? ) )
178181 |> metadata_for_ecto_repos ( )
179182 end
180183
184+ def maybe_checkout_repos ( _ , _ ) , do: ""
185+
181186 defp otp_app ( ) , do: Application . get_env ( :wallaby , :otp_app )
182187
183188 defp ecto_repos ( nil ) , do: [ ]
0 commit comments