1
1
@testset " activate_set.jl" begin
2
2
@testset " activate [extras]" begin
3
3
orig_project_toml_path = Base. active_project ()
4
+ push! (LOAD_PATH , mktempdir ()) # put something weird in LOAD_PATH for testing
5
+ orig_load_path = Base. LOAD_PATH
4
6
try
5
7
TestEnv. activate (" ChainRulesCore" )
6
8
new_project_toml_path = Base. active_project ()
7
9
@test new_project_toml_path != orig_project_toml_path
10
+ @test orig_load_path == Base. LOAD_PATH
8
11
9
- @eval using StaticArrays
12
+ @eval using StaticArrays # From ChainRulesCore [extras] Project.toml
13
+ @test isdefined (@__MODULE__ , :StaticArrays )
14
+
15
+ @eval using Compat # from ChainRulesCore Project.toml
10
16
@test isdefined (@__MODULE__ , :StaticArrays )
11
17
finally
12
18
Pkg. activate (orig_project_toml_path)
19
+ # No longer is enviroment active
20
+ @test_throws ArgumentError @eval using OffsetArrays
13
21
end
14
22
end
15
23
16
24
@testset " activate test/Project" begin
17
25
orig_project_toml_path = Base. active_project ()
26
+ push! (LOAD_PATH , mktempdir ()) # put something weird in LOAD_PATH for testing
27
+ orig_load_path = Base. LOAD_PATH
18
28
try
19
29
# YAXArrays has a test/Project.toml, which contains CSV
20
30
TestEnv. activate (" YAXArrays" )
21
31
new_project_toml_path = Base. active_project ()
22
32
@test new_project_toml_path != orig_project_toml_path
33
+ @test orig_load_path == Base. LOAD_PATH
23
34
24
35
@eval using CSV
25
36
@test isdefined (@__MODULE__ , :CSV )
37
+
26
38
finally
27
39
Pkg. activate (orig_project_toml_path)
28
40
end
29
41
end
30
- end
42
+ end
0 commit comments