[vtk-developers] Update: Making Tests Python 3/2 compatible.

Andrew Maclean andrew.amaclean at gmail.com
Sat Aug 8 00:51:13 EDT 2015


David you have done a fantastic job!


Just letting you know that by making python 3 changes to rtImageTest.py,
info.py, catch.py and expr.py,

I am now getting 89% tests passed, 54 tests failed out of 481!

In rtImageTest.py, Tkinter is now tkinter in Python 3.
For handling renamed libraries is code like this acceptable (it works in
Python 2 and 3):
##################
try:
    # for Python2
    print('Trying Python2')
    import Tkinter as tk
    print('Python2 Ok')
except ImportError:
    # for Python3
    print('Trying Python3')
    import tkinter as tk
    print('Python3 Ok')
pythonTk = tk.Tk()
##################

The remaining failing tests are mainly related to the print statement,
failures relating to string.find [in vtkMethodParser.py], no module named
exceptions etc.

I need to do some thorough testing on  rtImageTest.py, info.py, catch.py,
expr.py, vtkMethodParser.py for both Python 2.7 and Python 3.4

I am so impressed that these few changes have worked.

I'll try and get all the tests passing for Python 2 and Python 3 in the
next week or so and create a merge request for review.

Regards
    Andrew


-- 
___________________________________________
Andrew J. P. Maclean

___________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150808/abf4e271/attachment.html>


More information about the vtk-developers mailing list