We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a6a42bd commit f6dd1d5Copy full SHA for f6dd1d5
src/test_utils/contexts.jl
@@ -25,16 +25,13 @@ This method ensures that `context`
25
- Correctly implements the tilde-pipeline.
26
"""
27
function test_context(context::DynamicPPL.AbstractContext, model::DynamicPPL.Model)
28
- # `NodeTrait`.
29
node_trait = DynamicPPL.NodeTrait(context)
30
- # Throw error immediately if it it's missing a `NodeTrait` implementation.
31
- node_trait isa Union{DynamicPPL.IsLeaf,DynamicPPL.IsParent} ||
32
- error("Invalid NodeTrait: $node_trait")
33
-
34
if node_trait isa DynamicPPL.IsLeaf
35
test_leaf_context(context, model)
36
- else
+ elseif node_trait isa DynamicPPL.IsParent
37
test_parent_context(context, model)
+ else
+ error("Invalid NodeTrait: $node_trait")
38
end
39
40
0 commit comments