Skip to content

Commit a439678

Browse files
committed
fix: Fix tests on windows
1 parent fd9c40f commit a439678

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

python/embedded_python_test.go

+2-8
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ import (
66
"github.com/stretchr/testify/assert"
77
"io"
88
"math/rand"
9-
"os/exec"
10-
"path/filepath"
11-
"runtime"
129
"testing"
1310
)
1411

@@ -19,13 +16,10 @@ func TestEmbeddedPython(t *testing.T) {
1916
defer ep.Cleanup()
2017
path := ep.GetExtractedPath()
2118
assert.NotEqual(t, path, "")
22-
pexe := filepath.Join(path, "bin/python3")
23-
if runtime.GOOS == "windows" {
24-
pexe += ".exe"
25-
}
19+
pexe := ep.GetExePath()
2620
assert.True(t, internal.Exists(pexe))
2721

28-
cmd := exec.Command(pexe, "-c", "print('test')")
22+
cmd := ep.PythonCmd("-c", "print('test')")
2923
stdout, err := cmd.StdoutPipe()
3024
assert.NoError(t, err)
3125
defer stdout.Close()

0 commit comments

Comments
 (0)