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

David Gobbi david.gobbi at gmail.com
Sat Aug 8 08:48:22 EDT 2015


Wow, I didn't expect so many of the tests to be passing so soon. Thanks for
looking into these so quickly!

I just merged some fixes to my own 2 to 3 changes for
Common/Core/Testing/Python and Wrapping/Python/vtk.  These are mainly fixes
to "print" calls that I'd been lazy with the first time.

So please rebase either onto the current master or onto this commit:
https://gitlab.kitware.com/dgobbi/vtk/commit/26ad0555

Cheers,

 - David

On Fri, Aug 7, 2015 at 10:51 PM, Andrew Maclean <andrew.amaclean at gmail.com>
wrote:

> 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/5aedab9d/attachment.html>


More information about the vtk-developers mailing list