Skip to content

Commit c0dcd73

Browse files
committed
test: move pysr test to integration folder
1 parent ee55517 commit c0dcd73

File tree

2 files changed

+45
-49
lines changed

2 files changed

+45
-49
lines changed

pytest/integration/pysr.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
def test_integration_pysr():
2+
"Integration tests for PySR"
3+
import os
4+
import platform
5+
import subprocess
6+
import sys
7+
import tempfile
8+
9+
with tempfile.TemporaryDirectory() as tempdir:
10+
subprocess.run([sys.executable, "-m", "virtualenv", tempdir], check=True)
11+
12+
virtualenv_path = os.path.join(
13+
tempdir, "Scripts" if platform.system() == "Windows" else "bin"
14+
)
15+
virtualenv_executable = os.path.join(virtualenv_path, "python")
16+
17+
assert os.path.exists(virtualenv_executable)
18+
19+
# Install this package
20+
subprocess.run([virtualenv_executable, "-m", "pip", "install", "."], check=True)
21+
# Install PySR with no requirement on JuliaCall
22+
subprocess.run(
23+
[virtualenv_executable, "-m", "pip", "install", "--no-deps", "pysr"],
24+
check=True,
25+
)
26+
# Install PySR test requirements
27+
subprocess.run(
28+
[
29+
virtualenv_executable,
30+
"-m",
31+
"pip",
32+
"install",
33+
"sympy",
34+
"pandas",
35+
"scikit_learn",
36+
"click",
37+
"setuptools",
38+
"pytest",
39+
],
40+
check=True,
41+
)
42+
# Run PySR main test suite
43+
subprocess.run(
44+
[virtualenv_executable, "-m", "pysr", "test", "main"], check=True
45+
)

pytest/test_all.py

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -164,52 +164,3 @@ def test_call_nogil(yld, raw):
164164
t2 = time() - t0
165165
# executing the tasks should take about 1 second because they happen in parallel
166166
assert 0.9 < t2 < 1.5
167-
168-
169-
def test_integration_pysr():
170-
"Integration tests for PySR"
171-
import os
172-
import platform
173-
import subprocess
174-
import sys
175-
import tempfile
176-
177-
with tempfile.TemporaryDirectory() as tempdir:
178-
subprocess.run([sys.executable, "-m", "virtualenv", tempdir], check=True)
179-
180-
virtualenv_path = os.path.join(
181-
tempdir, "Scripts" if platform.system() == "Windows" else "bin"
182-
)
183-
virtualenv_executable = os.path.join(virtualenv_path, "python")
184-
185-
assert os.path.exists(virtualenv_executable)
186-
187-
# Install this package
188-
subprocess.run([virtualenv_executable, "-m", "pip", "install", "."], check=True)
189-
# Install PySR with no requirement on JuliaCall
190-
subprocess.run(
191-
[virtualenv_executable, "-m", "pip", "install", "--no-deps", "pysr"],
192-
check=True,
193-
)
194-
# Install PySR test requirements
195-
subprocess.run(
196-
[
197-
virtualenv_executable,
198-
"-m",
199-
"pip",
200-
"install",
201-
"sympy",
202-
"pandas",
203-
"scikit_learn",
204-
"click",
205-
"setuptools",
206-
"typing_extensions",
207-
"pytest",
208-
"nbval",
209-
],
210-
check=True,
211-
)
212-
# Run PySR main test suite
213-
subprocess.run(
214-
[virtualenv_executable, "-m", "pysr", "test", "main"], check=True
215-
)

0 commit comments

Comments
 (0)