summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul J. Davis <paul.joseph.davis@gmail.com>2019-12-25 11:30:25 -0600
committerPaul J. Davis <paul.joseph.davis@gmail.com>2019-12-25 13:52:32 -0600
commitdd50fa67b1a473ccf4529c9403f12322cf5e5688 (patch)
tree993aa7ef4f50a02ac752938a125dd46dfff96eea
parent3880c0bf0880c52636a98130d508b63df4af63c2 (diff)
downloadcouchdb-dd50fa67b1a473ccf4529c9403f12322cf5e5688.tar.gz
Speedup eunit: chttpd_view
-rw-r--r--src/chttpd/src/chttpd_view.erl35
1 files changed, 26 insertions, 9 deletions
diff --git a/src/chttpd/src/chttpd_view.erl b/src/chttpd/src/chttpd_view.erl
index 50704687e..f73a8b7b1 100644
--- a/src/chttpd/src/chttpd_view.erl
+++ b/src/chttpd/src/chttpd_view.erl
@@ -123,13 +123,18 @@ assert_no_queries_param(_) ->
check_multi_query_reduce_view_overrides_test_() ->
{
- foreach,
- fun setup/0,
- fun teardown/1,
- [
- t_check_include_docs_throw_validation_error(),
- t_check_user_can_override_individual_query_type()
- ]
+ setup,
+ fun setup_all/0,
+ fun teardown_all/1,
+ {
+ foreach,
+ fun setup/0,
+ fun teardown/1,
+ [
+ t_check_include_docs_throw_validation_error(),
+ t_check_user_can_override_individual_query_type()
+ ]
+ }
}.
@@ -153,7 +158,7 @@ t_check_user_can_override_individual_query_type() ->
end).
-setup() ->
+setup_all() ->
Views = [#mrview{reduce_funs = [{<<"v">>, <<"_count">>}]}],
meck:expect(couch_mrview_util, ddoc_to_mrst, 2, {ok, #mrst{views = Views}}),
meck:expect(chttpd, start_delayed_json_response, 4, {ok, resp}),
@@ -162,8 +167,20 @@ setup() ->
meck:expect(chttpd, end_delayed_json_response, 1, ok).
-teardown(_) ->
+teardown_all(_) ->
meck:unload().
+setup() ->
+ meck:reset([
+ chttpd,
+ couch_mrview_util,
+ fabric
+ ]).
+
+
+teardown(_) ->
+ ok.
+
+
-endif.