Skip to content

Commit

Permalink
remove the global test option and use it locally instead
Browse files Browse the repository at this point in the history
  • Loading branch information
bvdmitri committed Nov 24, 2023
1 parent 94a7f7e commit c72bd8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions test/distributions/distributions_setuptests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ function test_exponentialfamily_interface(distribution;
test_fisherinformation_against_hessian = true,
test_fisherinformation_against_jacobian = true,
option_assume_no_allocations = false,
option_test_samples_logpdf = true
)
T = ExponentialFamily.exponential_family_typetag(distribution)

Expand All @@ -71,7 +70,7 @@ function test_exponentialfamily_interface(distribution;
test_distribution_conversion && run_test_distribution_conversion(distribution; assume_no_allocations = option_assume_no_allocations)
test_packing_unpacking && run_test_packing_unpacking(distribution)
test_isproper && run_test_isproper(distribution; assume_no_allocations = option_assume_no_allocations)
test_basic_functions && run_test_basic_functions(distribution; assume_no_allocations = option_assume_no_allocations, test_samples_logpdf = option_test_samples_logpdf)
test_basic_functions && run_test_basic_functions(distribution; assume_no_allocations = option_assume_no_allocations)
test_fisherinformation_properties && run_test_fisherinformation_properties(distribution)
test_fisherinformation_against_hessian && run_test_fisherinformation_against_hessian(distribution; assume_no_allocations = option_assume_no_allocations)
test_fisherinformation_against_jacobian && run_test_fisherinformation_against_jacobian(distribution; assume_no_allocations = option_assume_no_allocations)
Expand Down Expand Up @@ -193,7 +192,7 @@ function run_test_isproper(distribution; assume_no_allocations = true)
end
end

function run_test_basic_functions(distribution; nsamples = 10, test_gradients = true, assume_no_allocations = true, test_samples_logpdf = true)
function run_test_basic_functions(distribution; nsamples = 10, test_gradients = true, test_samples_logpdf = true, assume_no_allocations = true)
T = ExponentialFamily.exponential_family_typetag(distribution)

ef = @inferred(convert(ExponentialFamilyDistribution, distribution))
Expand Down
6 changes: 4 additions & 2 deletions test/distributions/mv_normal_wishart_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ end
@testset let (d = MvNormalWishart(rand(dim), invS, rand(), ν))
ef = test_exponentialfamily_interface(
d;
option_test_samples_logpdf = false,
option_assume_no_allocations = false,
test_basic_functions = false,
test_fisherinformation_against_hessian = false,
test_fisherinformation_against_jacobian = false,
test_fisherinformation_against_jacobian = false
)

run_test_basic_functions(ef; assume_no_allocations = false, test_samples_logpdf = false)
end
end
end
Expand Down

0 comments on commit c72bd8b

Please sign in to comment.