Skip to content

Commit 7b18f56

Browse files
committed
fix unit test w/ difference on Windows
1 parent ae1a83c commit 7b18f56

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

internal/interpreters/python_test.go

+12-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package interpreters
55
import (
66
"errors"
77
"os"
8+
"runtime"
89
"testing"
910

1011
"github.com/posit-dev/publisher/internal/executor/executortest"
@@ -119,14 +120,22 @@ func (s *PythonSuite) TestGetPythonExecutableFallbackPython() {
119120
i, err := NewPythonInterpreter(s.cwd, util.NewPath("", s.fs), log, executor, pathLooker, MockExistsTrue)
120121
s.NoError(err)
121122
defaultPython := i.(*defaultPythonInterpreter)
122-
s.Equal("/some/python", defaultPython.pythonExecutable.String())
123+
if runtime.GOOS == "windows" {
124+
s.Equal("D:\\some\\python", defaultPython.pythonExecutable.String())
125+
} else {
126+
s.Equal("/some/python", defaultPython.pythonExecutable.String())
127+
}
123128

124129
p, err := i.GetPythonExecutable()
125130
s.Nil(err)
126-
s.Equal(p.String(), "/some/python")
131+
if runtime.GOOS == "windows" {
132+
s.Equal("D:\\some\\python", p.String())
133+
} else {
134+
s.Equal("/some/python", p.String())
135+
}
127136
v, err := i.GetPythonVersion()
128137
s.Nil(err)
129-
s.Equal(v, "3.10.4")
138+
s.Equal("3.10.4", v)
130139
}
131140

132141
func (s *PythonSuite) TestGetPythonExecutableNoRunnablePython() {

0 commit comments

Comments
 (0)