Skip to content

Commit 603c5f4

Browse files
committed
Use correct python for subprocess
1 parent c48a68e commit 603c5f4

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.coveragerc

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[run]
22
omit =
33
*/test/*
4+
source = pysr

pysr/test/test_startup.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import os
12
import subprocess
3+
import sys
24
import tempfile
35
import textwrap
46
import unittest
@@ -57,7 +59,7 @@ def test_warm_start_from_file(self):
5759
# Now, create a new process and warm start from the file:
5860
result = subprocess.run(
5961
[
60-
"python",
62+
sys.executable,
6163
"-c",
6264
textwrap.dedent(
6365
f"""
@@ -91,6 +93,7 @@ def test_warm_start_from_file(self):
9193
],
9294
stdout=subprocess.PIPE,
9395
stderr=subprocess.PIPE,
96+
env=os.environ,
9497
)
9598
self.assertEqual(result.returncode, 0)
9699
self.assertIn("Loading model from file", result.stdout.decode())
@@ -117,9 +120,10 @@ def test_bad_startup_options(self):
117120
]
118121
for warning_test in warning_tests:
119122
result = subprocess.run(
120-
["python", "-c", warning_test["code"]],
123+
[sys.executable, "-c", warning_test["code"]],
121124
stdout=subprocess.PIPE,
122125
stderr=subprocess.PIPE,
126+
env=os.environ,
123127
)
124128
self.assertIn(warning_test["msg"], result.stderr.decode())
125129

0 commit comments

Comments
 (0)