| 965 | } |
| 966 | |
| 967 | func writeGoMod(t *testing.T, pkgDir, tstDir string) { |
| 968 | template := ` |
| 969 | module dummy |
| 970 | |
| 971 | require github.com/go-python/gopy v0.0.0 |
| 972 | replace github.com/go-python/gopy => %s |
| 973 | ` |
| 974 | contents := fmt.Sprintf(template, pkgDir) |
| 975 | if err := os.WriteFile(filepath.Join(tstDir, "go.mod"), []byte(contents), 0666); err != nil { |
| 976 | t.Fatalf("failed to write go.mod file: %v", err) |
| 977 | } |
| 978 | } |
| 979 | |
| 980 | func testPkgBackend(t *testing.T, pyvm string, table pkg) { |
| 981 | curPkgPath := reflect.TypeOf(table).PkgPath() |