If you use PythonEngine.ImportModule on a file that contains multiple dots in its name (for example test.one.py), the ImportModule statement will fail and return null.
Embedded UnitTest is sadly lacking at the moment. I'll add pyimport.cs to the EmbeddingTest project with the understanding that this may open a whole new can of worms...
This works against the alpha-2 release:
/// Test subdirectory import
/// Requires the directory structure to exist where python will find it.
/// (I used
/// site-packages/ to contain the tree:)
public void TestDottedName()
module = PythonEngine.ImportModule("dotnet.test.one");
Assert.IsNotNull(module, ">>> import dotnet.test.one # FAILED");
Glad to see this get fixed. Thank you!
This is most likely a red herring: The original post gives a hint that vpiattelli didn't quite have have a handle on python import semantics "(for example test.one.py)"' leaving the extension in place. But it was a great excuse to tear into the UnitTest classes and play around. I've uploaded the results onto the trunk.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.