import unittest
import permstruct
import permstruct.dag

class TestTravis(unittest.TestCase):
    def test_travis(self):
        perm_prop = lambda p: p.avoids([2,3,1])
        perm_bound = 6
        inp_dag = permstruct.dag.incr_decr(perm_prop, perm_bound)
        sol_iter = permstruct.construct_rule(perm_prop, perm_bound, inp_dag, (3, 3), 4, 100)
        for sol in sol_iter:

            print '===================================='
            print ""
            for rule in sol:
                print(rule)
                print ""


@@ -48,16 +48,27 @@
 ruct.dag
+%0Aimport sys
 %0A%0Aclass 
@@ -397,22 +397,33 @@
         
-print 
+sys.stdout.write(
 '=======
@@ -451,17 +451,20 @@
 ========
-'
+%5Cn')
 %0A       
@@ -468,24 +468,38 @@
         
-print %22%22
+sys.stdout.write('%5Cn')
 %0A       
@@ -540,42 +540,39 @@
     
-print(rule)%0A                print %22%22
+sys.stdout.write('%25s%5Cn%5Cn' %25 rule)
 %0A%0A

Make tests working with python 2 and 3