@@ -23,31 +23,31 @@ import (
2323var (
2424 testBackends = map [string ]string {}
2525 features = map [string ][]string {
26- "_examples/hi" : []string {"py3" }, // output is different for 2 vs. 3 -- only checking 3 output
27- "_examples/funcs" : []string {"py2" , " py3" },
28- "_examples/sliceptr" : []string {"py2" , " py3" },
29- "_examples/simple" : []string {"py2" , " py3" },
30- "_examples/empty" : []string {"py2" , " py3" },
31- "_examples/named" : []string {"py2" , " py3" },
32- "_examples/structs" : []string {"py2" , " py3" },
33- "_examples/consts" : []string {"py2" , " py3" }, // 2 doesn't report .666 decimals
34- "_examples/vars" : []string {"py2" , " py3" },
35- "_examples/seqs" : []string {"py2" , " py3" },
36- "_examples/cgo" : []string {"py2" , " py3" },
37- "_examples/pyerrors" : []string {"py2" , " py3" },
38- "_examples/iface" : []string {"py3" }, // output order diff for 2, fails but actually works
39- "_examples/pointers" : []string {"py2" , " py3" },
40- "_examples/arrays" : []string {"py2" , " py3" },
41- "_examples/slices" : []string {"py2" , " py3" },
42- "_examples/maps" : []string {"py2" , " py3" },
43- "_examples/gostrings" : []string {"py2" , " py3" },
44- "_examples/rename" : []string {"py2" , " py3" },
45- "_examples/lot" : []string {"py2" , " py3" },
46- "_examples/unicode" : []string {"py3" }, // doesn't work for 2
47- "_examples/osfile" : []string {"py2" , " py3" },
48- "_examples/gopygc" : []string {"py2" , " py3" },
49- "_examples/cstrings" : []string {"py2" , " py3" },
50- "_examples/pkgconflict" : []string {"py2" , " py3" },
26+ "_examples/hi" : []string {"py3" },
27+ "_examples/funcs" : []string {"py3" },
28+ "_examples/sliceptr" : []string {"py3" },
29+ "_examples/simple" : []string {"py3" },
30+ "_examples/empty" : []string {"py3" },
31+ "_examples/named" : []string {"py3" },
32+ "_examples/structs" : []string {"py3" },
33+ "_examples/consts" : []string {"py3" },
34+ "_examples/vars" : []string {"py3" },
35+ "_examples/seqs" : []string {"py3" },
36+ "_examples/cgo" : []string {"py3" },
37+ "_examples/pyerrors" : []string {"py3" },
38+ "_examples/iface" : []string {"py3" },
39+ "_examples/pointers" : []string {"py3" },
40+ "_examples/arrays" : []string {"py3" },
41+ "_examples/slices" : []string {"py3" },
42+ "_examples/maps" : []string {"py3" },
43+ "_examples/gostrings" : []string {"py3" },
44+ "_examples/rename" : []string {"py3" },
45+ "_examples/lot" : []string {"py3" },
46+ "_examples/unicode" : []string {"py3" },
47+ "_examples/osfile" : []string {"py3" },
48+ "_examples/gopygc" : []string {"py3" },
49+ "_examples/cstrings" : []string {"py3" },
50+ "_examples/pkgconflict" : []string {"py3" },
5151 "_examples/variadic" : []string {"py3" },
5252 }
5353
@@ -130,7 +130,6 @@ ignoring python incompatible function: .func github.com/go-python/gopy/_examples
130130func TestHi (t * testing.T ) {
131131 // t.Parallel()
132132 path := "_examples/hi"
133- // NOTE: output differs for python2 -- only valid checking for 3
134133 testPkg (t , pkg {
135134 path : path ,
136135 lang : features [path ],
@@ -216,7 +215,7 @@ caught: can't work for 24 hours!
216215--- p.Salary(24): caught: can't work for 24 hours!
217216--- Person.__init__
218217caught: argument 2 must be str, not int | err-type: <class 'TypeError'>
219- caught: an integer is required (got type str) | err-type: <class 'TypeError'>
218+ caught: 'str' object cannot be interpreted as an integer | err-type: <class 'TypeError'>
220219*ERROR* no exception raised!
221220hi.Person{Name="name", Age=0}
222221hi.Person{Name="name", Age=42}
@@ -923,7 +922,6 @@ type pkg struct {
923922}
924923
925924func testPkg (t * testing.T , table pkg ) {
926- // backends := []string{"py2", "py3"}
927925 backends := []string {"py3" }
928926 // backends := table.lang // todo: enabling py2 testing requires separate "want" output
929927 for _ , be := range backends {
@@ -935,11 +933,6 @@ func testPkg(t *testing.T, table pkg) {
935933 continue
936934 }
937935 switch be {
938- case "py2" :
939- t .Run (be , func (t * testing.T ) {
940- // t.Parallel()
941- testPkgBackend (t , vm , table )
942- })
943936 case "py3" :
944937 t .Run (be , func (t * testing.T ) {
945938 // t.Parallel()
@@ -1062,6 +1055,10 @@ func testPkgBackend(t *testing.T, pyvm string, table pkg) {
10621055 diff , _ := cmd .CombinedOutput ()
10631056 diffTxt = string (diff ) + "\n "
10641057 }
1058+ t .Fatalf ("[%s:%s]: error running python module:\n %s" ,
1059+ pyvm , table .path ,
1060+ diffTxt ,
1061+ )
10651062 }
10661063
10671064 t .Fatalf ("[%s:%s]: error running python module:\n got:\n %s\n \n want:\n %s\n [%s:%s] diff:\n %s" ,
0 commit comments