Skip to content

Commit

Permalink
close files before removing
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierlabayle committed Dec 22, 2023
1 parent 592c675 commit 1518216
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
11 changes: 6 additions & 5 deletions test/runner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ end
@test results_from_hdf5[i][estimator].estimand isa TMLE.Estimand
end
end

close(results_from_hdf5)
# Clean
rm(outputs.json.filename)
rm(outputs.hdf5.filename)
Expand Down Expand Up @@ -285,11 +285,12 @@ end
@test length(results_from_json) == 3

# HDF5
results_from_json = jldopen("output.hdf5")
@test length(results_from_json["Batch_1"]) == 2
composed_result = only(results_from_json["Batch_2"])
results_from_hdf5 = jldopen("output.hdf5")
@test length(results_from_hdf5["Batch_1"]) == 2
composed_result = only(results_from_hdf5["Batch_2"])
@test composed_result.OSE.cov == results[3].OSE.cov

close(results_from_hdf5)

rm(datafile)
rm("output.jls")
rm("output.json")
Expand Down
3 changes: 3 additions & 0 deletions test/sieve_variance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@ end
@test src_result.TMLE.n == svp_result.TMLE.n
@test svp_result.TMLE.IC == []
end
close(tmleout1)
close(tmleout2)
close(io)
# clean
rm("svp.hdf5")
Expand Down Expand Up @@ -361,6 +363,7 @@ end
@test standalone_estimates[i].OSE.std != src_results[i].OSE.std
end

close(src_results)
close(io)

# clean
Expand Down
4 changes: 4 additions & 0 deletions test/summary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ include(joinpath(TESTDIR, "testutils.jl"))
@test input.OSE.estimand == jls_output.OSE.estimand == hdf5_out.OSE.estimand == json_output[:OSE].estimand
end

close(hdf5file_1)
close(hdf5file_2)
close(hdf5_output)

# cleanup
rm("tmle_output_1.hdf5")
rm("tmle_output_2.hdf5")
Expand Down

0 comments on commit 1518216

Please sign in to comment.