diff --git a/libs/python/pythontest/pythontest.go b/libs/python/pythontest/pythontest.go index 8500c0f246..e43a1974b4 100644 --- a/libs/python/pythontest/pythontest.go +++ b/libs/python/pythontest/pythontest.go @@ -12,7 +12,6 @@ import ( "testing" "github.com/databricks/cli/internal/testutil" - "github.com/databricks/cli/libs/python" "github.com/stretchr/testify/require" ) @@ -108,8 +107,4 @@ func RequireActivatedPythonEnv(t *testing.T, ctx context.Context, opts *VenvOpts newPath := fmt.Sprintf("%s%c%s", opts.BinPath, os.PathListSeparator, os.Getenv("PATH")) t.Setenv("PATH", newPath) - - pythonExe, err := python.DetectExecutable(ctx) - require.NoError(t, err) - require.Equal(t, filepath.Dir(pythonExe), filepath.Dir(opts.PythonExe)) } diff --git a/libs/python/pythontest/pythontest_test.go b/libs/python/pythontest/pythontest_test.go index d8eeca64b3..8af24d7189 100644 --- a/libs/python/pythontest/pythontest_test.go +++ b/libs/python/pythontest/pythontest_test.go @@ -2,8 +2,11 @@ package pythontest import ( "context" + "os/exec" + "path/filepath" "testing" + "github.com/databricks/cli/libs/python" "github.com/stretchr/testify/require" ) @@ -17,6 +20,11 @@ func TestVenvSuccess(t *testing.T) { require.DirExists(t, opts.EnvPath) require.DirExists(t, opts.BinPath) require.FileExists(t, opts.PythonExe) + + pythonExe, err := exec.LookPath(python.GetExecutable()) + require.NoError(t, err) + require.Equal(t, filepath.Dir(pythonExe), filepath.Dir(opts.PythonExe)) + require.FileExists(t, pythonExe) }) } }