Skip to content

Commit a16b018

Browse files
mtfishmanclaude
andauthored
Drop redundant @eval module $(gensym()) wrapper from test files (#343)
`ITensorPkgSkeleton.runtests` already wraps each test file in its own `Module(gensym(:SafeTestset))` (see `_run_isolated_testfile` in ITensorPkgSkeleton). The per-file `@eval module $(gensym())` wrapper at the top of each test file therefore creates a redundant module-inside-a-module. Remove the leading `@eval module $(gensym())` and the matching trailing `end` from all 22 test files that carried it. The four files that already used the bare-module style (`test/test_aqua.jl`, `test/solvers/test_eigsolve.jl`, `test/solvers/test_applyexp.jl`, `test/solvers/test_iterators.jl`) are unchanged. Bump patch version 0.19.3 -> 0.19.4 (test-only diff, substantive per the standard `VersionCheck` classification). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9c22dd7 commit a16b018

23 files changed

Lines changed: 1 addition & 45 deletions

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ITensorNetworks"
22
uuid = "2919e153-833c-4bdc-8836-1ea460a35fc7"
3-
version = "0.19.3"
3+
version = "0.19.4"
44
authors = ["Matthew Fishman <mfishman@flatironinstitute.org>, Joseph Tindall <jtindall@flatironinstitute.org> and contributors"]
55

66
[workspace]

test/test_abstractgraph.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@eval module $(gensym())
21
using Graphs: add_edge!, add_vertex!
32
using NamedGraphs.GraphsExtensions: is_binary_arborescence, is_rooted, root_vertex
43
using NamedGraphs: NamedDiGraph
@@ -16,4 +15,3 @@ using Test: @test, @testset
1615
add_edge!(g, 1, 4)
1716
@test !is_binary_arborescence(g)
1817
end
19-
end

test/test_additensornetworks.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@eval module $(gensym())
21
using Graphs: rem_edge!, vertices
32
using ITensorNetworks: ITensorNetwork, inner_network, orthogonalize, siteinds, truncate, ttn
43
using ITensors: ITensors, apply, inner, op, scalar
@@ -86,4 +85,3 @@ end
8685
@test ITensors.allfluxequal(ITensors.tensor(ϕ[v]))
8786
end
8887
end
89-
end

test/test_apply.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@eval module $(gensym())
21
using Compat: Compat
32
using Graphs: vertices
43
using ITensorNetworks:
@@ -74,4 +73,3 @@ include("utils.jl")
7473
@test real(fGBP * conj(fGBP)) >= real(fSBP * conj(fSBP))
7574
end
7675
end
77-
end

test/test_belief_propagation.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@eval module $(gensym())
21
using Compat: Compat
32
using Graphs: vertices
43
using ITensorNetworks: ITensorNetworks, @preserve_graph, BeliefPropagationCache,
@@ -86,4 +85,3 @@ using Test: @test, @testset
8685
@test iszero(scalar(ψ; alg = "bp"))
8786
end
8887
end
89-
end

test/test_contraction_sequence.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@eval module $(gensym())
21
using ITensorNetworks: contraction_sequence, norm_sqr_network, siteinds
32
using ITensors: ITensors, contract
43
using NamedGraphs.NamedGraphGenerators: named_grid
@@ -43,4 +42,3 @@ include("utils.jl")
4342
end
4443
end
4544
end
46-
end

test/test_examples.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@eval module $(gensym())
21
using ITensorNetworks: ITensorNetworks
32
using Suppressor: @suppress
43
using Test: @testset
@@ -9,4 +8,3 @@ using Test: @testset
98
@suppress include(joinpath(pkgdir(ITensorNetworks), "examples", example_file))
109
end
1110
end
12-
end

test/test_expect.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@eval module $(gensym())
21
using Graphs: SimpleGraph, uniform_tree
32
using ITensorNetworks:
43
BeliefPropagationCache, ITensorNetwork, expect, original_state_vertex, siteinds
@@ -50,4 +49,3 @@ include("utils.jl")
5049
sz_exact = expect(ψ, "Sz"; alg = "exact")
5150
@test sz_bp sz_exact
5251
end
53-
end

test/test_forms.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@eval module $(gensym())
21
using DataGraphs: underlying_graph
32
using Graphs: nv
43
using ITensorNetworks: BeliefPropagationCache, BilinearFormNetwork, LinearFormNetwork,
@@ -91,4 +90,3 @@ include("utils.jl")
9190
qf = QuadraticFormNetwork(ψket)
9291
@test scalar(qf; alg = "exact") inner(ψket, ψket; alg = "exact")
9392
end
94-
end

test/test_indsnetwork.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@eval module $(gensym())
21
using DataGraphs: edge_data, vertex_data
32
using Dictionaries: Dictionary
43
using Graphs: edges, ne, nv, vertices
@@ -181,4 +180,3 @@ end
181180
@test all(issetequal(is_m[v], union(is1[v], is2[v])) for v in vertices(c))
182181
@test all(issetequal(is_m[e], union(is1[e], is2[e])) for e in edges(c))
183182
end
184-
end

0 commit comments

Comments
 (0)