Search code examples
visual-studiovisual-studio-2010ironpythonironpython-studio

How do I run unit tests with IronPython Studio?


I have recently had to move my project from using the CPython 2.6 interpreter in Eclipse with the PyDev plugin to IronPython 2.7 interpreter using IronPython Studios in Visual Studios 2010. Unfortunately I am a bit new to VS2010 and VS in general. There seems to be plenty of tool selections related to setting up all the tests I would want but when I select these tools, they all seem to want their tests to be in either C++, C#, or VB. Also, it seems I can only set a single file to be the active file where the flow of execution starts. I want to be able to run my collection of Python unit tests with the IronPython interpreter through Visual Studios (if possible). How would I go about doing this?


Solution

  • I would suggest that you move to Python Tools for Visual Studio instead of IronPython Studio. IpyStudio is pretty old, having been replaced by IronPython Tools for Visual Studio and that being replaced by PTVS. PTVS also supports IronPython 2.7 + CPython 2.5 - 3.2, has much better intellisense, and is generally just much more mature.

    None of these unfortunately have integrated unit test support - the best you can do is switch the script which is currently set as the startup script. You can do that via the context menu in Solution Explorer if you were currently doing it by updating the project properties page, that might make it easier.

    We're looking at doing integrated unit test support for a future version of PTVS, probably 2.0. Out of curiosity, what test framework are you using?