Spaces:
Running
Running
MilesCranmer
commited on
Commit
•
7d036ff
1
Parent(s):
3c653a1
Clean up formatting
Browse files- test/test_env.py +7 -3
test/test_env.py
CHANGED
@@ -21,8 +21,12 @@ class TestJuliaProject(unittest.TestCase):
|
|
21 |
os.environ["JULIA_DEPOT_PATH"] = tmpdir
|
22 |
else:
|
23 |
old_env = os.environ["JULIA_DEPOT_PATH"]
|
24 |
-
os.environ[
|
25 |
-
|
|
|
|
|
|
|
|
|
26 |
test_env_name = "@pysr_test_env"
|
27 |
julia_helpers.install(julia_project=test_env_name)
|
28 |
Main = julia_helpers.init_julia(julia_project=test_env_name)
|
@@ -30,7 +34,7 @@ class TestJuliaProject(unittest.TestCase):
|
|
30 |
# Try to use env:
|
31 |
Main.eval("using SymbolicRegression")
|
32 |
Main.eval("using Pkg")
|
33 |
-
|
34 |
# Assert we actually loaded it:
|
35 |
cur_project_dir = Main.eval("splitdir(dirname(Base.active_project()))[1]")
|
36 |
potential_shared_project_dirs = Main.eval("Pkg.envdir(DEPOT_PATH[1])")
|
|
|
21 |
os.environ["JULIA_DEPOT_PATH"] = tmpdir
|
22 |
else:
|
23 |
old_env = os.environ["JULIA_DEPOT_PATH"]
|
24 |
+
os.environ[
|
25 |
+
"JULIA_DEPOT_PATH"
|
26 |
+
] = f"{tmpdir}:{os.environ['JULIA_DEPOT_PATH']}"
|
27 |
+
Main.eval(
|
28 |
+
f'pushfirst!(DEPOT_PATH, "{julia_helpers._escape_filename(tmpdir)}")'
|
29 |
+
)
|
30 |
test_env_name = "@pysr_test_env"
|
31 |
julia_helpers.install(julia_project=test_env_name)
|
32 |
Main = julia_helpers.init_julia(julia_project=test_env_name)
|
|
|
34 |
# Try to use env:
|
35 |
Main.eval("using SymbolicRegression")
|
36 |
Main.eval("using Pkg")
|
37 |
+
|
38 |
# Assert we actually loaded it:
|
39 |
cur_project_dir = Main.eval("splitdir(dirname(Base.active_project()))[1]")
|
40 |
potential_shared_project_dirs = Main.eval("Pkg.envdir(DEPOT_PATH[1])")
|