summaryrefslogtreecommitdiff
path: root/test/test_helper.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2023-12-12 15:54:55 +0000
committerlain <lain@soykaf.club>2023-12-12 15:54:55 +0000
commit2c560266e948f44a7dffa44747a75c6d5eb7495a (patch)
tree4691aa019fd0d5f015e33dcb8e5119fc50f38939 /test/test_helper.exs
parent31a524fb525db03aaa333901f50bc7ab6fbfc68e (diff)
parentcca6c20eb6acd0f510054d1a1050d12ea2a32482 (diff)
downloadpleroma-2c560266e948f44a7dffa44747a75c6d5eb7495a.tar.gz
pleroma-2c560266e948f44a7dffa44747a75c6d5eb7495a.zip
Merge branch 'no-async-clear-config' into 'develop'
Various test improvements and refactors See merge request pleroma/pleroma!3991
Diffstat (limited to 'test/test_helper.exs')
-rw-r--r--test/test_helper.exs16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/test_helper.exs b/test/test_helper.exs
index 7727cffbc..27b777d5f 100644
--- a/test/test_helper.exs
+++ b/test/test_helper.exs
@@ -4,8 +4,7 @@
Code.put_compiler_option(:warnings_as_errors, true)
-os_exclude = if :os.type() == {:unix, :darwin}, do: [skip_on_mac: true], else: []
-ExUnit.start(exclude: [:federated, :erratic] ++ os_exclude)
+ExUnit.start(exclude: [:federated, :erratic])
Ecto.Adapters.SQL.Sandbox.mode(Pleroma.Repo, :manual)
@@ -18,3 +17,16 @@ ExUnit.after_suite(fn _results ->
uploads = Pleroma.Config.get([Pleroma.Uploaders.Local, :uploads], "test/uploads")
File.rm_rf!(uploads)
end)
+
+defmodule Pleroma.Test.StaticConfig do
+ @moduledoc """
+ This module provides a Config that is completely static, built at startup time from the environment. It's safe to use in testing as it will not modify any state.
+ """
+
+ @behaviour Pleroma.Config.Getting
+ @config Application.get_all_env(:pleroma)
+
+ def get(path, default \\ nil) do
+ get_in(@config, path) || default
+ end
+end