IronPython for unit testing with IronPython Studios

I wanted to play with IronPython and thought that unit tests were a pretty easy way to get started. This essentially means that my core application code will still be written in C #, and my tests were python.

Given this, my ideal situation was to develop C # and IronPython code from the same solution in Visual studioios. Looking around, I see that there is an editor for the visual studios "IronPythonStudios", which should be right for me, although so far I have raised several problems:

  • Importing basic python libraries such as "Import os" fails. I believe this is because the path to these shared libraries is not set in the IDE, and I have no idea how to install it.
  • I can not recognize .pyproj files from visual studios, I believe that my version of IronPythonStudios works in isolated mode and is not integrated. Any idea how I am changing this?
  • IronPythonStudos seems to be compiling .py files instead of just interpreting them. This Essentailly means unit testing is as slow as running C # / Vb.net as a test, and then the exectue loop still exists. Any idea how to stop VS / IPS from compiling files and just make it just dynamically compile scripts?

Hi Chris.

+3
source share
3 answers

, - , , , Pythons sys path i.e.

import sys
sys.path.append(r'c:\PathToPythonCommonLibs')

EDIT:

, IronPython, .

+1

IronPython Visual Studio. , SDK Visual Studio . , IPy v 1.x, 2. *. , .

+1

ipy 2.6 pydev eclipse. , IDE ( , ), IDE, Visual Studio Eclipse. , , - IDE, . , # eclipse, .

pydev eclipse , , . , / .

+1

Source: https://habr.com/ru/post/1706265/


All Articles