X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fsupport%2Fdata_case.ex;h=0ee2aa4a23204da337cef9d7e6ce9a573e11ff96;hb=7bbaa8f8e07044726c5b97b9ab8126ca41f2fd78;hp=1f33450e63da80b466b6b3bfd7224e8753f1ae82;hpb=b5899fda1a38c2ce2d26ebd5082d864c84105622;p=akkoma diff --git a/test/support/data_case.ex b/test/support/data_case.ex index 1f33450e6..0ee2aa4a2 100644 --- a/test/support/data_case.ex +++ b/test/support/data_case.ex @@ -64,7 +64,7 @@ defmodule Pleroma.DataCase do end) end - setup tags do + def setup_multi_process_mode(tags) do :ok = Ecto.Adapters.SQL.Sandbox.checkout(Pleroma.Repo) if tags[:async] do @@ -72,11 +72,16 @@ defmodule Pleroma.DataCase do Mox.set_mox_private() else Ecto.Adapters.SQL.Sandbox.mode(Pleroma.Repo, {:shared, self()}) - Mox.stub_with(Pleroma.CachexMock, Pleroma.CachexProxy) + Mox.set_mox_global() + Mox.stub_with(Pleroma.CachexMock, Pleroma.CachexProxy) clear_cachex() end + :ok + end + + def setup_streamer(tags) do if tags[:needs_streamer] do start_supervised(%{ id: Pleroma.Web.Streamer.registry(), @@ -85,6 +90,12 @@ defmodule Pleroma.DataCase do }) end + :ok + end + + setup tags do + setup_multi_process_mode(tags) + setup_streamer(tags) stub_pipeline() Mox.verify_on_exit!()