-
Notifications
You must be signed in to change notification settings - Fork 749
MSTests failing when importing a module with imports #262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@gatapia good finding, let me link this here: @BartonCline originally implemented this test, not sure if he recalls any issues like that? |
This occasionally also shows up when using If I run each test separately they run with no problems.
|
I'm actually pretty certain that this always happens if we do |
@filmor absolutely right. Just wrote a test on it and got it to fail by just doing and verified that it did work on Good reads related:
Second time this line runs it returns an invalid pointer. |
Almost got it, its a messy one... this section creates an exception that gets taken care of by moduleobject the first time around when |
Still don't fully understand the issue, however, I think the whole |
until we find a way for clean initialize and shutdown, can we get rid of setup and teardown of nunit tests in the meantime? so just have one initialize and one shutdown for all embedding tests. |
@denfromufa That may work since I'm adding a test explicitly for this. I want to understand this issue a bit more before doing that change. |
I think I've got it, working on minimising the change now: At least one of the problems is the call |
Keeping the PyMethodDef around like the documentation (https://docs.python.org/3.6/c-api/module.html#c.PyModuleDef) suggests fixes issue pythonnet#262.
Keeping the PyMethodDef around like the documentation (https://docs.python.org/3.6/c-api/module.html#c.PyModuleDef) suggests fixes issue pythonnet#262.
Keeping the PyMethodDef around like the documentation (https://docs.python.org/3.6/c-api/module.html#c.PyModuleDef) suggests fixes issue pythonnet#262.
Keeping the PyMethodDef around like the documentation (https://docs.python.org/3.6/c-api/module.html#c.PyModuleDef) suggests fixes issue pythonnet#262.
Keeping the PyMethodDef around like the documentation (https://docs.python.org/3.6/c-api/module.html#c.PyModuleDef) suggests fixes issue pythonnet#262.
Keeping the PyMethodDef around like the documentation (https://docs.python.org/3.6/c-api/module.html#c.PyModuleDef) suggests fixes issue pythonnet#262.
Keeping the PyMethodDef around like the documentation (https://docs.python.org/3.6/c-api/module.html#c.PyModuleDef) suggests fixes issue pythonnet#262.
Keeping the PyMethodDef around like the documentation (https://docs.python.org/3.6/c-api/module.html#c.PyModuleDef) suggests fixes issue pythonnet#262.
Keeping the PyMethodDef around like the documentation (https://docs.python.org/3.6/c-api/module.html#c.PyModuleDef) suggests fixes issue pythonnet#262.
Keeping the PyMethodDef around like the documentation (https://docs.python.org/3.6/c-api/module.html#c.PyModuleDef) suggests fixes issue pythonnet#262.
Keeping the PyMethodDef around like the documentation (https://docs.python.org/3.6/c-api/module.html#c.PyModuleDef) suggests fixes issue pythonnet#262.
Fixed on PY27, still buggy on py3+ |
Very simple to reproduce:
In the Python.EmbeddingTests project (I am using master branch):
import numpy as np
as first lineThis error is also being shown in my ASP.Net Web API application on restart so I hope a solution will solve both MSTest and ASP.Net.
Further Information: Full version of pyimport.cs after edits is:
The text was updated successfully, but these errors were encountered: