[Python.NET] Passing .NET objects to Python

Barton barton at bcdesignswell.com
Sun Jul 3 01:38:56 CEST 2011


The source code for the pythondotnet project has a great example of 
this. There is a copy [although, not quite up-to-date] of the project on 
the github repository which even has nUnit unit test framework built in.

This project uses pure python to load the test assembly via unittest for 
a fairly complete test of the pythondotnet assembly itself.

On 06/05/2011 03:06 PM, Meredith, Christopher wrote:
> Greetings.
>
> I have a test framework written in C# that handles test execution,
> logging, reporting, etc., and some tests for some of our hardware that
> are written in Python. Ideally, I’m wanting to call Setup(), Run() and
> TearDown() methods defined in Python scripts, passing them an instance
> of the object I have that handles logging as a parameter (or defining it
> globally from the perspective of the loaded script). Whilst I can find
> methods that load entire Python scripts and call them from .NET, I can’t
> seem to find anything in the documentation or defined publicly in
> Python.Runtime.dll. Is this doable? Is this documented?
>
> Thanks,
>
> Chris Meredith
>
> Test Engineer, North American Embedded Professional Services
>
> Email: christopher.meredith at nuance.com
> <mailto:christopher.meredith at nuance.com>
>
>
>
> _________________________________________________
> Python.NET mailing list - PythonDotNet at python.org
> http://mail.python.org/mailman/listinfo/pythondotnet


More information about the PythonDotNet mailing list