开发者

Using IronPython so I can test normal Python scripts in .net

We are mostly a .NET shop and want to cover everything with the Fitness acceptance testing framework. Recently we had to write a couple of scripts for unix and we used python. Now the suggestion has been made that we should write Fitness tests for these python scripts and integrate them into our automated test process.

What would be the general strategy for doing this? Should I start a python project in visual studio and add the python scripts to it and expect it to work? Should I use a normal c# project and some look for some sort of compiler or interpreter in IronPython that can load these python scripts and either run them as is, or generate a .net assembly out of them or something?

Does anyone with experience in IronPython have a good suggestion?

Also what is the latest version of IronPython (and visual studio integration tools) that supports .net 3.5 and visual studio 2008 without compiling anything?

I tried the latest but it only supports .net 4 and vs 2010. So I tried 2.6 but i开发者_Python百科t doesn't seem to come with visual studio integration.

Thanks


You can do it either way. We use IronPython runtime embedded in our code so we use the hosting options to test any python via c# unit test classes. Remember you can use fire up an Iron Python Engine (3.5) or DLR based script host (4.0) and give it a string.

In 3.5 there is no DLR to the Iron Python 1.1 is the order of the day, whereas in 4.0 the DLR supports IronPython 2.6 out of the box, and there is a codeplex update that is python 2.7 level.

However of the key aspects of automated unit testing is to use the language that's close to the original language so the other way is probably 'more' classical!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜