Skip to content

Commit b8f4217

Browse files
authored
Merge pull request #237 from JuliaDiff/ox/fixout
In checking method table don't nest testsets
2 parents a1b0ed0 + ed673f0 commit b8f4217

File tree

2 files changed

+23
-27
lines changed

2 files changed

+23
-27
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ChainRulesTestUtils"
22
uuid = "cdddcdb0-9152-4a09-a978-84456f9df70a"
3-
version = "1.5.0"
3+
version = "1.5.1"
44

55
[deps]
66
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"

src/global_checks.jl

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,37 +22,33 @@ was parametric, or `Union` if `Foo` was a type alias for a `Union`)
2222
function test_method_signature end
2323

2424
function test_method_signature(::typeof(rrule), method::Method)
25-
@testset "Sensible Constructors" begin
26-
function_type = if method.sig <: Tuple{Any, RuleConfig, Type, Vararg}
27-
_parameters(method.sig)[3]
28-
elseif method.sig <: Tuple{Any, Type, Vararg}
29-
_parameters(method.sig)[2]
30-
else
31-
nothing
32-
end
33-
34-
@test_msg(
35-
"Bad constructor rrule. `typeof(T)` used rather than `Type{T}`. $method",
36-
function_type (DataType, UnionAll, Union)
37-
)
25+
function_type = if method.sig <: Tuple{Any, RuleConfig, Type, Vararg}
26+
_parameters(method.sig)[3]
27+
elseif method.sig <: Tuple{Any, Type, Vararg}
28+
_parameters(method.sig)[2]
29+
else
30+
nothing
3831
end
32+
33+
@test_msg(
34+
"Bad constructor rrule. `typeof(T)` used rather than `Type{T}`. $method",
35+
function_type (DataType, UnionAll, Union)
36+
)
3937
end
4038

4139
function test_method_signature(::typeof(frule), method::Method)
42-
@testset "Sensible Constructors" begin
43-
function_type = if method.sig <: Tuple{Any, RuleConfig, Any, Type, Vararg}
44-
_parameters(method.sig)[4]
45-
elseif method.sig <: Tuple{Any, Any, Type, Vararg}
46-
_parameters(method.sig)[3]
47-
else
48-
nothing
49-
end
50-
51-
@test_msg(
52-
"Bad constructor frule. `typeof(T)` used rather than `Type{T}`. $method",
53-
function_type (DataType, UnionAll, Union)
54-
)
40+
function_type = if method.sig <: Tuple{Any, RuleConfig, Any, Type, Vararg}
41+
_parameters(method.sig)[4]
42+
elseif method.sig <: Tuple{Any, Any, Type, Vararg}
43+
_parameters(method.sig)[3]
44+
else
45+
nothing
5546
end
47+
48+
@test_msg(
49+
"Bad constructor frule. `typeof(T)` used rather than `Type{T}`. $method",
50+
function_type (DataType, UnionAll, Union)
51+
)
5652
end
5753

5854
"""

0 commit comments

Comments
 (0)