Skip to content

Commit

Permalink
Fix tests using complex print to run under python3.
Browse files Browse the repository at this point in the history
Separation is needed, because print is a statement in python3.
  • Loading branch information
stephan-hof committed Jun 8, 2017
1 parent bf149dc commit 1a8ab38
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Products/PythonScripts/tests/testPythonScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
##############################################################################
import os
import six
import sys
import unittest
import warnings

Expand Down Expand Up @@ -203,7 +204,8 @@ def testSimplePrint(self):
self.assertEqual(res, 'a\n')

def testComplexPrint(self):
res = self._filePS('complex_print')()
script = 'complex_print_py%s' % sys.version_info.major
res = self._filePS(script)()
self.assertEqual(res, 'double\ndouble\nx: 1\ny: 0 1 2\n\n')

def testNSBind(self):
Expand All @@ -219,7 +221,8 @@ def testBooleanMap(self):
self.failUnless(res)

def testGetSize(self):
f = self._filePS('complex_print')
script = 'complex_print_py%s' % sys.version_info.major
f = self._filePS(script)
self.assertEqual(f.get_size(), len(f.read()))

def testBuiltinSet(self):
Expand Down
Binary file not shown.

0 comments on commit 1a8ab38

Please sign in to comment.