Closed
Description
Environment
- Pythonnet version:
v2.2.2
- Python version:
all
- Operating System:
Windows
Details
- Describe what you were trying to get done.
Replace nUnit
to xUnit
framework.
- What commands did you run to trigger this issue? If you can provide a
Minimal, Complete, and Verifiable example
this will help us understand the issue.
Below is one of the tests rewritten for xUnit
using System.Collections.Generic;
using Xunit;
using Python.Runtime;
namespace Python.EmbeddingTest
{
public class PyIterTest
{
[Fact]
public void TestOnPyList()
{
using (Py.GIL())
{
var list = new PyList();
list.Append(new PyString("foo"));
list.Append(new PyString("bar"));
list.Append(new PyString("baz"));
var result = new List<string>();
foreach (PyObject item in list)
{
result.Add(item.ToString());
}
Assert.Equal(3, result.Count);
Assert.Equal("foo", result[0]);
Assert.Equal("bar", result[1]);
Assert.Equal("baz", result[2]);
}
}
}
}
- If there was a crash, please include the traceback here.
Error msg: Fatal Python error: PyImport_GetModuleDict: no module dictionary!
Metadata
Metadata
Assignees
Labels
No labels